This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Question on disabling textfield but maintaining value entered via jquery function Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Question on disabling textfield but maintaining value entered via jquery function" Watch "Question on disabling textfield but maintaining value entered via jquery function" New topic
Author

Question on disabling textfield but maintaining value entered via jquery function

Melinda Savoy
Ranch Hand

Joined: Jun 21, 2005
Posts: 386

I have a text field called toAccountAmt that is auto populated with the reverse amount of what is entered in the fromAccountAmt field. However, I need to be able to populate the reverse amount in the toAccountAmt field but prevent the user from being able to change it.

I tried to disable as stated below but the disable function remove the value when the form is submitted. I need to maintain the value that I'm entering via the code below when I click the submit button.

Is there a way to do what I'm needing? Any help/direction would be greatly appreciated. Regards.

Here is my jquery code:

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60766
    
  65

As I mentioned in your JSF topic, you need readOnly, not disabled.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Melinda Savoy
Ranch Hand

Joined: Jun 21, 2005
Posts: 386

I did not see a reply on the incorrect post to the JSF forum.

That got it. Thanks.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60766
    
  65

Hmm, was removed for some reason. In an case, readOnly will disallow input while keeping the input submittable.
 
wood burning stoves
 
subject: Question on disabling textfield but maintaining value entered via jquery function
 
Similar Threads
Question on making a dropdown list read-only
Question on .submit and reloading form values AFTER the submit button is clicked
trying to populate hidden field on my JSF form using jQuery
jQuery and JSF - NEWBIE question
Question on using jQuery's .attr AFTER form is submitted