*
The moose likes HTML, CSS and JavaScript and the fly likes Javascript to Submit the Value of a Text Field Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Javascript to Submit the Value of a Text Field" Watch "Javascript to Submit the Value of a Text Field" New topic
Author

Javascript to Submit the Value of a Text Field

Natalie Kopple
Ranch Hand

Joined: May 06, 2003
Posts: 325
I am getting into deep trouble.

My link is defined inside a form. Everything is tested without problem except that the link does not pick up the value of a text field that is also defined inside the form. Although the link does pick up fixed values and they are submitted.

Therefore, I have to use Javascript to submit the value of a textfield when the link is clicked.

Moreover to my problem. I have several text fields in the form. A client may or may not enter a value in any one of those text fields. But, all the entered values must be submitted when the link is clicked.
Please help me.


[ July 19, 2006: Message edited by: Natalie Kopple ]

[ July 19, 2006: Message edited by: Natalie Kopple ]

[ July 19, 2006: Message edited by: Bear Bibeault ]
[ July 20, 2006: Message edited by: Natalie Kopple ]
Pavan Keely
Ranch Hand

Joined: Jun 30, 2006
Posts: 62
Check whether the value is assigned to text field properly.

You mean to say that text field value is not being sent to server on form submit ?


Pavan Keely<br /><a href="http://keelypavan.blogspot.com" target="_blank" rel="nofollow">http://keelypavan.blogspot.com</a>
Natalie Kopple
Ranch Hand

Joined: May 06, 2003
Posts: 325
I mean that the value of the text field is not sent by clicking on the "link". The "link" invokes an action.

Both the text field and the link are inside a pair of "form" tag.

Please, I need a Javascript.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60785
    
  65

Please post the HTML of the form, field and link in question.

Note: post the rendered HTML, not the JSP source full of struts tags.

You're probably not forming the URL correctly to pass the value.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
jQuery in Action, 2nd edition
 
subject: Javascript to Submit the Value of a Text Field
 
Similar Threads
The Package In Which Primitives Are Defined?
Is Null, Not an Object, or Not Defined
regarding request.getParameter() function
One Form with Many Links (Each has Its Specifics)
c:url and encodeURL()