aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Disabling a field in java script Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Disabling a field in java script" Watch "Disabling a field in java script" New topic
Author

Disabling a field in java script

Vijayalakshmi Karthikeyan
Greenhorn

Joined: Jul 23, 2010
Posts: 27
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

Joined: Jan 10, 2002
Posts: 60046
    
  65

Why all the complicated referencing? Just give the element an id value, and use the id with document.getElementById().


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
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

Joined: Jul 23, 2010
Posts: 27
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. .
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Disabling a field in java script
 
Similar Threads
ResultSet not working
spaces while populating using s:iterator
Securuty with javascript ?
how to use selectOneRadio with javascript?
about checking values between rows with dynamic table created using java script