Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New Coder
    Join Date
    May 2005
    Posts
    37
    Thanks
    0
    Thanked 0 Times in 0 Posts

    disable input text

    i have 3 radio button.
    1st radio button is checked.
    when i clik another radio button i want to disable the input text.how?

  • #2
    New Coder
    Join Date
    May 2005
    Posts
    37
    Thanks
    0
    Thanked 0 Times in 0 Posts

    carik sendiri la

    carik sendiri la, hahahaha

  • #3
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,048
    Thanks
    0
    Thanked 251 Times in 247 Posts

    Pls speak in english...

    Quote Originally Posted by kalosneri
    carik sendiri la, hahahaha

  • #4
    New Coder
    Join Date
    May 2005
    Posts
    37
    Thanks
    0
    Thanked 0 Times in 0 Posts

    input text disable

    i have one input text and 3 radio button..
    1st radio button is checked..
    i want if i checked 2dn or 3rd radio button
    that input text must be disable.
    can u tell me how to do that???

  • #5
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,048
    Thanks
    0
    Thanked 251 Times in 247 Posts
    Something like this?
    Code:
    <input type="radio" name="rad" id="rad1" value="1" checked="checked" onclick="this.form.txtOther.disabled=true" /><label for="rad1">Item 1</label>
    <input type="radio" name="rad" id="rad2" value="2" onclick="this.form.txtOther.disabled=true" /><label for="rad2">Item 2</label>
    <input type="radio" name="rad" id="rad3" value="3" onclick="this.form.txtOther.disabled=false;this.form.txtOther.focus()" /><label for="rad3">Other</label><input type="text" name="txtOther" />

  • #6
    Senior Coder
    Join Date
    Feb 2003
    Posts
    1,665
    Thanks
    0
    Thanked 27 Times in 25 Posts
    e.g.
    Code:
    function doCheck(id) {
    	var myTextObj = document.getElementById('myText');
    	(document.getElementById(id).value == '01') ? myTextObj.disabled = false : myTextObj.disabled = true ; 
    }
    Code:
    <label for="rad01" onclick="doCheck('rad01');">Option 01
    	<input type="radio" name="rad" id="rad01" value="01" checked="checked" />
    </label>
    
    <label for="rad02" onclick="doCheck('rad02');">Option 02
    	<input type="radio" name="rad" id="rad02" value="02" />
    </label>
    
    <label for="rad03" onclick="doCheck('rad03');">Option 03
    	<input type="radio" name="rad" id="rad03" value="03" />
    </label>
    
    <input type="text" id="myText" value="default" />
    Last edited by Bill Posters; 05-30-2005 at 08:44 AM.

  • #7
    New Coder
    Join Date
    May 2005
    Posts
    37
    Thanks
    0
    Thanked 0 Times in 0 Posts

    tq

    ok tq


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •