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
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: 61766
    
  67

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. .
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Disabling a field in java script