This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes HTML, CSS and JavaScript and the fly likes Help on conditionally disabling the fields Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Help on conditionally disabling the fields" Watch "Help on conditionally disabling the fields" New topic
Author

Help on conditionally disabling the fields

ms raaghu
Ranch Hand

Joined: Jul 10, 2009
Posts: 66
hi,
I have two radio button say
radio 1 and 2 respectively..
and a text field.. ..... on page load the radio 1 will be selected
so based on that condition textfield shld be disabled ?
please let me know how can i achieve this.. ?

i have written a function where on change the textfield will be disabled but when the page refreshed the disability
is gone for a toss...so please tell how dis can be done??
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61084
    
  66

ms raaghu wrote:how dis can be done??

dis? What is "dis"?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
ms raaghu
Ranch Hand

Joined: Jul 10, 2009
Posts: 66
Sorry "dis" refers to "THIS"
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
on window.onload look at what the radio button is set to and call your function that enables and disables.

Eric
 
jQuery in Action, 2nd edition
 
subject: Help on conditionally disabling the fields