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 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jun 2003
    Location
    Australia
    Posts
    528
    Thanks
    8
    Thanked 8 Times in 8 Posts

    onChange... make radio CHECKED

    Okay.. I have looked around a bit to find what I'm looking for but can't (or more to the point I'm too buggered, 18 hours scripting and I'm over it!)

    This is a simple thing I'm sure.. but I'm just a PHP-er.. thats my excuse and I'm sticking to it! lol

    Here is what I want:

    My form:

    <table cellspacing=1 cellpadding=3 bgcolor=black width=95%>
    <tr>
    <td colspan=2 class=boxtitle align=center>Create Team</td>
    </tr>
    <tr><form method='post' name='regteam'>
    <td class=tlist1 align=center><input type=radio name=newteam value=new CHECKED> Start New Team: <input type=text name=newtname maxlength=50 size=30><br/>
    or<br/>
    <input type=radio name=newteam value=join> Join A Team: <select name=jid>$jointeambox</select><br/><br/>
    Team Password: <input type=text name=password maxlength=10>
    </td>
    </tr>
    <tr>
    <td colspan=2 class=boxtitle align=center><input type=submit name=submit value='Create Team'></td>
    </form>
    </tr>
    </table>

    NOTE: $jointeambox is my PHP variable of the options for select.

    What I need is when someone changes the select box, that the radio button beside it becomes checked. I know I'll need onChange.. but not sure how to write whats needed to make the radio checked.

    Thanks in advance for any help!

  • #2
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    onchange="if(this.value)this.form['newteam'][1].checked=1;else this.form['newteam'][1].checked=0"


  •  

    Posting Permissions

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