3,892 Posted Topics

Member Avatar for maulee
Member Avatar for jiggy_g

Insert line breaks in server side code, in your case that being ASP. The formatting will be preserved as it is in the textarea. Your rendered textarea should look like: [code] <textarea cols="55" rows="10" name="txtDescription">Location: Atlanta-30th Floor-3034B Occupant: Andersen, Jason Current Station Type: Floor Shared</textarea>[/code]

Member Avatar for ~s.o.s~
0
91
Member Avatar for michael123

> I have a form text field called "field_0", and javascript code: First of all, your markup is broken. The HTML tag attributes need to be in the form of key-value pairs with the value being enclosed in double quotes. > However if I change a little in javascript code …

Member Avatar for ~s.o.s~
0
119
Member Avatar for brr

[code] <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta http-equiv="Expires" content="0" /> <!-- disable caching --> <title>Ajax Example</title> <script type="text/javascript"> function check(frm) { var dataIsValid = true; /* all your validation/processing code goes here */ if(dataIsValid) { alert("Form successfully submitted!"); return(true); } else …

Member Avatar for DangerDev
0
617
Member Avatar for piers

Will code for money; it doesn't matter whether it's C, C++, Java or C# as long it's a general purpose, fairly famous programming language. It's my job to churn out quality software which I think I am quite good at, though I must agree the language you program in greatly …

Member Avatar for neocoder
0
350
Member Avatar for oreo_cheesecake

I disagree. Even after all these years, Java still has to go a long way when compared to C++, at least in terms of Game Development. The kind of raw power achieved by C / C++ _can't_ be offered by Java. Compare and contrast the implementation of different languages in …

Member Avatar for beefstick720
0
949
Member Avatar for nikk

Use the Apache commons upload library to ease the task of image uploading. Once you get hold of the image, store it in the database as a BLOB (Binary Large Object). and retrieve it back as a stream of bytes which can be used for recreating the image. Maybe [URL="http://www.informit.com/articles/article.aspx?p=25280&rll=1"]this …

Member Avatar for ~s.o.s~
0
253
Member Avatar for scru

Of course, I don't know about others but at least my browser has some etiquette. ;-)

Member Avatar for scru
0
71
Member Avatar for The Dude

~s.o.s~ stands for a smart and cool universal savior with beautiful angel wings. ;-)

Member Avatar for maui_mallard
0
245
Member Avatar for Tom Tolleson

> Is this possible? Yes, very much possible. Use the DOM API. Below I present a minimalistic code snippet which replaces a button element with a text element. [code] <html> <head> <script type="text/javascript"> function change(elem) { var newElement = document.createElement("input"); newElement.type = "text"; newElement.id = "txtName"; newElement.name = "txtName"; elem.parentNode.replaceChild(newElement, …

Member Avatar for phillman17
0
109
Member Avatar for brr

You need to use Ajax for it. There are many decent Ajax frameworks out there which you can use with a minimalistic knowledge of Javascript. Your query is by far too generic, post your code if you get stuck and we might be in a better position to help you …

Member Avatar for brr
0
81
Member Avatar for eddy556

Which record are you talking about anyways? Please make an attempt to at least specify the exact nature of your problem as explicitly as possible instead of letting the one helping you out to do all the thinking.

Member Avatar for dogma
0
279
Member Avatar for tylerrr

> The following works correctly in IE7 but doesn't work in Firefox. Any idea? Because you are trying to retrieve the element using the id "testfield" but you don't have any element having an id "testfield", only one with a name "testfield". It works in IE because IE approximates or …

Member Avatar for DangerDev
0
291
Member Avatar for Lioshenka

Look into the RandomAccessFile class. The only downside being the file is a treated as a sequence of bytes rather than the conventional line oriented view which many are used to. This class is especially for example useful when you want to come up with your custom file format which …

Member Avatar for ~s.o.s~
0
3K
Member Avatar for Dave Sinkula

> Sharp eyes, good job for noticing that. Wasn't it expected given the bulging eyes? ;-)

Member Avatar for ~s.o.s~
0
345
Member Avatar for ceyesuma

> Is there a JavaScript api to look at methods? I googled and I didn't find anything familiar. I > am used to the java api. Look at the documentation provided by [URL="http://www.w3schools.com/js/default.asp"]w3schools[/URL], [URL="http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference"]Mozilla devleopment center[/URL] and [URL="http://msdn2.microsoft.com/en-us/library/yek4tbz0.aspx"]MSDN [/URL]on Javascript.

Member Avatar for Renincuente
0
81
Member Avatar for ihtraa

Involving javascript for doing automatic number generation is the worst choice you could have made. Just allow a [URL="http://java.sun.com/blueprints/corej2eepatterns/Patterns/DataAccessObject.html"]DAO class[/URL] of that specific table handle the job of automatic number generation which would typically be exposed through some function like getNext().

Member Avatar for ~s.o.s~
0
1K
Member Avatar for Robtyketto

Accessing the database from JSP which is meant for display / view purposes is a bad practice. Put all your database access code in a servlet which would then set the retrieved data in a session or request scoped variable which would then be accordingly rendered in the JSP file. …

Member Avatar for ~s.o.s~
0
147
Member Avatar for nikk

An option would be to use the Java library iText to convert the given text to PDF which can be then written back to the browser. Generating image from text seems to be a pretty complicated task; something which I haven't personally tried out. Maybe [URL="http://today.java.net/pub/a/today/2004/04/22/images.html"]this [/URL]article will help you …

Member Avatar for ~s.o.s~
0
55
Member Avatar for eddy556

You will have to cast it to the reference type you are expecting it to return. This is because the specifications say that getAttribute() returns a variable of type Object which of course makes sense since it enables us to store a reference variable of any kind. Maybe something along …

Member Avatar for ~s.o.s~
0
124
Member Avatar for Asiima

[URL="http://www.daniweb.com/forums/thread108582.html"]This [/URL]post contains some useful information pertaining to your issue.

Member Avatar for ~s.o.s~
0
122
Member Avatar for nikk

AFAIK, a session object is automatically created as soon as a request to a resource is made. In the Servlet API, you can get hold of the session object using request.getSession(), which grabs hold of the session for the current request. The way the session is maintained i.e. either by …

Member Avatar for ~s.o.s~
0
100
Member Avatar for nemo

Use the SimpleDateFormat class to parse the string into a Date object. Feed that Date object to the instance of the Calendar object and use it's function roll() to do the dirty work for you. Something along the lines of: [code] public class DateHelper { public static void main(String args[]) …

Member Avatar for ~s.o.s~
0
83
Member Avatar for eddy556

Your problem seems to be this line in your JSP file: > [icode] <%@ page import="mybeans.processFormBean" %>[/icode] What exactly is processFormBean here? Is it a package? Are you trying to import all the classes from the processBean package? If yes, then you are doing it the wrong way. To import …

Member Avatar for ~s.o.s~
0
230
Member Avatar for hbmarar

The thing you are trying to do is not recommended. Read [URL="http://www.daniweb.com/forums/thread106213.html"]this [/URL]thread as a reference which discusses a similar issue.

Member Avatar for ~s.o.s~
0
67
Member Avatar for eddy556

> I know I'm probably being dumb here but I cannot seem to compile a java bean. You are missing a static import in your package declaration. [icode]import static System.out;[/icode]

Member Avatar for ~s.o.s~
0
81
Member Avatar for nikk

Don't use statement, use PreparedStatement. Date can be stored database table using either java.sql.Date (only for dates) or java.sql.Timestamp (for date along with time). Read the [URL="http://java.sun.com/docs/books/tutorial/jdbc/index.html"]JDBC tutorials[/URL] for more details. Also each SQL implementation (i.e. each database) has it's own specific way of generating the current date, so if …

Member Avatar for ~s.o.s~
0
91
Member Avatar for The Dude

[quote=The Dude;299064]"If God is for us, who can be against us?" (Romans 8:31)[/quote] If God is against us, does it matter who is with us ? [sos 9:11] ;)

Member Avatar for twomers
4
518
Member Avatar for iamthwee
Member Avatar for eddy556

The == operator in case of references compares the references and not the values to which they refer. Since both id and key don't refer to the same string instance in memory, it always returns false. What you need here is to use the equals() method to do the same. …

Member Avatar for eddy556
0
170
Member Avatar for kittie1985

[code]public class FireFox { public static void main(String args[]) throws IOException { Runtime run = Runtime.getRuntime(); String url = "http://localhost:8080/myservlet/"; String ff = "your-path-to-firefox/firefox"; String command = ff + " " + url; run.exec(command); System.exit(0); } }[/code]

Member Avatar for ~s.o.s~
0
133
Member Avatar for gheibia

This is because you have specified a relative URL and with you currently in the "shipper" context, it's trying to find "UploadUnconfirmedSOServlet" in that context. What you can do here is either make use of absolute URL's or adjust your relative URL to suit your needs. Something like: [code] <form …

Member Avatar for gheibia
0
223
Member Avatar for ananda003

> i got a problem while running a jsp file from one pc in another pc,that jsp file contains hyper > link to another file I am not very sure I understand what you want here but try [url]http://hostNameOfAnotherMachine[/url] on the machine from which you want to access the host …

Member Avatar for ~s.o.s~
0
130
Member Avatar for pack

You need to escape the XML strings returned and convert the <, > and other characters which have special meaning in HTML to their [URL="http://www.w3schools.com/tags/ref_entities.asp"]HTML entities[/URL]. [quote]< - &lt; > - &gt; " - &quot;[/quote] You can try something like: [code] String str = ab.result(); str = str.replaceAll("<", "&lt;").replaceAll(">", "&gt;");[/code]

Member Avatar for ~s.o.s~
0
490
Member Avatar for >shadow<
Member Avatar for javaStud

What do you mean by doesn't work? Post a sample test case for which your code fails. And come to think of it: [code] Date EndDate = null; //get it from your db or log file... Calendar cal_lastlogin = Calendar.getInstance(); if(cal_lastlogin.before(calExpired)) { /* something */ }[/code] Here, you are pulling …

Member Avatar for javaStud
0
137
Member Avatar for m.cliter

Asking your question in the official [URL="http://tech.groups.yahoo.com/group/ydn-javascript/"]YUI forum/newsgroup[/URL] would be more beneficial IMO since almost everyone here uses his/her choice of Javascript library.

Member Avatar for ~s.o.s~
0
133
Member Avatar for Lardmeister

> My advice to jbennet and other young fellows, don't heed the crude advice of iamthwee or > his buddy josch. That kind of behaviour is disgusting, let them grab their own fat behinds, if > they enjoy it so much. Or be smart by acting the way ZZucker / …

Member Avatar for ~s.o.s~
2
307
Member Avatar for shashipkiran

The article [URL="http://www.javaworld.com/javaworld/jw-09-2004/jw-0927-logout.html"]Solving the logout problem[/URL] at Javaworld seems to be a good read.

Member Avatar for ~s.o.s~
0
76
Member Avatar for Ankita B

Yes, [ICODE]request.getParameter()[/ICODE] always returns a string unless you plan on challenging the API. As far as date is concerned, you can decide on a format which you would be expecting from your users. At the server side, pull the date values entered by the user as a string, try to …

Member Avatar for ~s.o.s~
0
78
Member Avatar for eddy556

> How do I pass parameters FROM the secondary JSP back the PRIMARY JSP not the other way > around? You can use session variables as common piggyback mechanism though I am not very sure what you mean by pass the parameters. The entire process of including the JSP is …

Member Avatar for ~s.o.s~
0
69
Member Avatar for toadzky

> It doesn't ever get that far. It returns the "Access denied error" on: Are you trying to make cross domain calls? What kind of URL are you using in your call anyways? Does it belong to your domain?

Member Avatar for ~s.o.s~
0
93
Member Avatar for dev.cplusplus

Use the [URL="http://www.quirksmode.org/dom/getstyles.html"]getStyles [/URL]function to get the CSS property of an element. You would probably get the width of the element in pixels but that should work fine for you.

Member Avatar for MidiMagic
0
90
Member Avatar for apontutul

Your code is far from being a proper XHTML document, but works in IE, since its really forgiving. A few things: [LIST] [*]All the form elements should go in the form tag. Its only when they go inside the form tag, a name attribute given to them is valid, otherwise …

Member Avatar for bruceshining
1
222
Member Avatar for Ene Uran

> I was told this forum was global, This fact still holds true. You seem to be having some weird notion of what global *actually* means. BTW, I am with EnderX on this one.

Member Avatar for maravich12
0
309
Member Avatar for freddypyther

Criticizing things without knowing where they are used and how they impact the software world is a bit uncalled for...

Member Avatar for jwenting
0
152
Member Avatar for KimJack

> I am just wondering can a linked list reference an array in another class? Yes, a linked list can contain references to an array of any reference type. [code] List<Integer[]> l = new LinkedList<Integer[]>(); l.add(new Integer[] {1,2,3});[/code] It would have been easier had it been done without generics but …

Member Avatar for ~s.o.s~
0
99
Member Avatar for OmniX

If you want to access the value of input element "input[n]" try [icode]document.forms[formName].elements["input[n]"].value[/icode] If you want the names of all the input elements, try:[code] function getInputNames(frm) { var arr = []; var elms = frm.getElementsByTagName("input"); for(var i = 0, max = elms.length; i < max; ++i) { arr[i] = elms[i].name; …

Member Avatar for ~s.o.s~
0
84
Member Avatar for certem

[quote=Ancient Dragon;306807]Probably not because such a class still has all the properties of double data type. You would need a class that does not depend on either float or double if you always want an exact precision. doubles and floats can not give that to you.[/quote] I guess his last …

Member Avatar for John A
0
245
Member Avatar for orico

Try [ICODE]document.forms[0].elements['yourElementName'].focus()[/ICODE]. Don't use [ICODE]document.all.[/ICODE] It's not a standard property of the [ICODE]document[/ICODE] object. And having a 1.8K line source file is bad in itself IMO.

Member Avatar for ~s.o.s~
0
103

The End.