File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes Question on using jQuery's .attr AFTER form is submitted 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
Reply locked New topic

Question on using jQuery's .attr AFTER form is submitted

Melinda Savoy
Ranch Hand

Joined: Jun 21, 2005
Posts: 386

I am using jQuery 1.4.3. In the following function I am setting a dropdown list to a DISABLED attribute as follows:

The issue is that when the form is SUBMITTED, the dropdown list becomes ENABLED for some reason if there is an error on the form. I need the dropdown list to maintain the DISABLED attribute AFTER the form is submitted. Am I doing something wrong in the code above that would alter the attribute after the form is submitted?

I tried creating a .submit function to validate a multitude a fields in my form but I don't know how to get the attribute of the dropdown list. Can someone please tell me how to do this?

Any suggestions/direction would be appreciated. Thank you.
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 60800

After the form is submitted, the page ceases to exist. I assume that after the servlet that processes the form is finished, that the same JSP page is displayed again?

If so, then you are getting a fresh page from the server that has nothing whatsoever to do with what went on the previous time that the page was displayed.

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

Joined: Jun 21, 2005
Posts: 386


Thanks for the reply. Based on your response I will post my next question regarding .submit(). Thanks again.
It is sorta covered in the JavaRanch Style Guide.
subject: Question on using jQuery's .attr AFTER form is submitted
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
Newbie question using jquery validator plugin on my JSF page
jQuery and JSF - NEWBIE question