This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
    Bookmark Topic Watch Topic
  • New Topic

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

 
Melinda Savoy
Ranch Hand
Posts: 387
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
Marshal
Pie
Posts: 65115
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
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.
 
Melinda Savoy
Ranch Hand
Posts: 387
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Report post to moderator
Bear,

Thanks for the reply. Based on your response I will post my next question regarding .submit(). Thanks again.
 
    Bookmark Topic Watch Topic
  • New Topic