Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Disabling a field in java script

 
Vijayalakshmi Karthikeyan
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a dynamic page
I just want to disable a field based on a selection of combo box..

Here is my code


On the view source-->


But it is not working. 1st alert gives me false and second alert gives me true. But on the page it is not disabled.

Can any one guide me
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65115
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why all the complicated referencing? Just give the element an id value, and use the id with document.getElementById().
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure what you combo box is, but is it causing the page to post back or something which is resetting the page?
 
Vijayalakshmi Karthikeyan
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi .
Am very sorry for late reply.
The form was fully dynamic and they were using some inner HTML.
Mistake was on my side. I have given wrong name. I found and corrected it.
Thank you all. .
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic