File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes JavaScript return string Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "JavaScript return string" Watch "JavaScript return string" New topic
Author

JavaScript return string

Pat Peg
Ranch Hand

Joined: Feb 04, 2005
Posts: 194
Hey all,

I am not sure why this isn't working. It populates the text box that I want the JS to return the value to but only for a second. Why isn't the value staying? I am guessing it has something to do with what is happening on submit but I don't know. Any help would be appreciated- more help is appreciated more
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

I'm not sure what you're trying to accomplish-that form (containing the value being set) isn't being submitted, so any value in that form will be lost. The first form *is* being submitted, causing a new request.
Pat Peg
Ranch Hand

Joined: Feb 04, 2005
Posts: 194
I've tried putting them all in one form and I've tried setting the output several different ways but it want keep the value. I don't understand what I am doing wrong or how to make it right.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

What do you mean by "keep the value"? After the form is submitted its values are gone unless you preload them somehow with values from the server.
Pat Peg
Ranch Hand

Joined: Feb 04, 2005
Posts: 194
OK-what I am trying to do is have a function that takes 2 values and populates a third field on the page based on the values passed in using javascript. How can this be done?
Pat Peg
Ranch Hand

Joined: Feb 04, 2005
Posts: 194
I figured it out. Instead of using onSubmit in the form I did this.


Thanks for the help-I appreciate it.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JavaScript return string
 
Similar Threads
Submit button problem
Unable to validate form using javascript
Combo box problem
validation rules for time
alternative to query string