3,892 Posted Topics
Re: 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] | |
Re: > 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 … | |
Re: [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 … | |
Re: 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 … | |
Re: 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 … | |
Re: 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 … | |
Re: Of course, I don't know about others but at least my browser has some etiquette. ;-) | |
Re: ~s.o.s~ stands for a smart and cool universal savior with beautiful angel wings. ;-) | |
Re: > 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, … | |
Re: 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 … | |
Re: 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. | |
Re: > 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 … | |
![]() | Re: 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 … |
Re: > Sharp eyes, good job for noticing that. Wasn't it expected given the bulging eyes? ;-) | |
Re: > 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. | |
Re: 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(). | |
Re: 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. … | |
Re: 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 … | |
Re: 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 … | |
Re: [URL="http://www.daniweb.com/forums/thread108582.html"]This [/URL]post contains some useful information pertaining to your issue. | |
Re: 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 … | |
Re: 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[]) … | |
Re: 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 … | |
Re: 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. | |
Re: > 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] | |
Re: 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 … | |
Re: [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] ;) | |
![]() | |
Re: 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. … | |
Re: [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] | |
Re: 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 … | |
Re: > 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 … | |
Re: 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]< - < > - > " - "[/quote] You can try something like: [code] String str = ab.result(); str = str.replaceAll("<", "<").replaceAll(">", ">");[/code] | |
Re: 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 … | |
Re: 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. | |
Re: > 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 / … | |
Re: 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. | |
Re: 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 … | |
Re: > 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 … | |
Re: > 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? | |
Re: 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. | |
Re: 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 … | |
Re: > 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. | |
Re: Criticizing things without knowing where they are used and how they impact the software world is a bit uncalled for... | |
Re: > 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 … | |
Re: 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; … | |
Re: [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 … | |
Re: 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. |
The End.