Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-13-2003, 02:59 AM   PM User | #1
jebster
New to the CF scene

 
Join Date: Jul 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
jebster is an unknown quantity at this point
Disabling input field if radio not equal to yes..

I have a text input field that I want disabled or readonly or whatever, unless the user selects the radio button with the value "yes"! How would I do this? Every attempt I have made has failed... I have very little skills when it comes to javascript!

Thanks
jebster is offline   Reply With Quote
Old 07-13-2003, 04:04 AM   PM User | #2
ACJavascript
Regular Coder

 
Join Date: Jun 2002
Location: FL, USA
Posts: 734
Thanks: 0
Thanked 0 Times in 0 Posts
ACJavascript is on a distinguished road
Well im not sure what type of browser support it will have but this does the trick
-----

<script language="javascript">

function check1(){
if(document.form1.box1.checked==true){
document.form1.input1.disabled=false
}else{
document.form1.input1.disabled=true
}
}
window.onload=check1
</script>

<form name="form1">
<input type="text" name="input1">
<BR>
<input type="radio" name="box1" onClick="check1()">
</form>
__________________
CYWebmaster.com - See why we dot com!!
ACJavascripts.com - Cut & Paste Javascripts!
SimplyProgram.com - Personal Blog
ACJavascript is offline   Reply With Quote
Old 07-13-2003, 06:58 AM   PM User | #3
jebster
New to the CF scene

 
Join Date: Jul 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
jebster is an unknown quantity at this point
Cool thanks!
jebster is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:38 AM.


Advertisement
Log in to turn off these ads.