|
-
Dec 29th, 2005, 01:20 PM
#1
Thread Starter
Hyperactive Member
Disabling Text on Radio Click [resolved]
I have several radio buttons on my site with the following tags.
HTML Code:
<INPUT TYPE="radio" NAME="index_Radio" VALUE="Radio A" SELECTED>
<INPUT TYPE="radio" NAME="index_Radio" VALUE="Radio B">
<INPUT TYPE="radio" NAME="index_Radio" VALUE="Radio C">
Then I have and input field with the following tag.
HTML Code:
<div id="first_name">
First Name:
</div>
<INPUT TYPE="text" NAME="first_name" SIZE="20" MAXLENGTH="10" ONCHANGE="this.value = this.value.toUpperCase()">
What do i need to do to have the First Name label and the text box disabled when I click on Radio A. And have it enabled when i click on B or C. Keep in mind that when the page loads A is selected already. So it needs to load disabled.
Thanks for you help
Last edited by mrstuff68; Jan 4th, 2006 at 10:48 AM.
-
Dec 29th, 2005, 02:01 PM
#2
Re: Disabling Text on Radio Click
You need to catch onclick on all three radios. See which one is selected. If it's A, disable the text field, otherwise enable it. On page load, do the same. (If you put the disabled attribute on the text field, it would be disabled on load, but if the user has JS disabled, it would stay so, which is not good.)
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jan 4th, 2006, 10:47 AM
#3
Thread Starter
Hyperactive Member
Re: Disabling Text on Radio Click
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|