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 3 of 3
  1. #1
    Abd
    Abd is offline
    New Coder
    Join Date
    Aug 2002
    Location
    Lagos, Nigeria
    Posts
    99
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Disabling Radio Button

    Hi All,

    Help, I have a form which I am populating with data from an Oracle Database, I have two Radio Buttons (Male & Female). Now if the returning Data is for a female, I want the Radio Button for male to be disable.

    Thanks
    Abd
    Abdul

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    Australia
    Posts
    197
    Thanks
    0
    Thanked 0 Times in 0 Posts
    you could try
    something like
    onClick='form.buttonname.checked=!form.buttonname.checked'
    which should keep it how it is currently set
    ez
    Animation Rule #64
    Poor quality images are often artistic,
    Poor quality sound is ALWAYS annoying.

  • #3
    Regular Coder
    Join Date
    Jan 2003
    Posts
    867
    Thanks
    4
    Thanked 8 Times in 8 Posts
    Is this for an "update" or "edit" type of page? It sounds like you are looking up some data in the database and setting a bunch of fields based on what the user initially entered.

    <%
    'open database and setup recordset first

    'what did the user enter
    user_choice=RS("gender")
    %>

    <form name="myform">
    <input type="radio" name="gender" value="female" <%if user_choice="female" then response.write "checked" else response.write "disabled"%>>female<br>
    <input type="radio" name="gender" value="male" <%if user_choice="male" then response.write "checked" else response.write "disabled"%>>male<br>
    </form>

    edit: Oops, this will only work if you use ASP.
    Last edited by arnyinc; 03-17-2003 at 09:50 PM.


  •  

    Posting Permissions

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