Forums
This topic is locked
Radiobutton to reset Dropdown list
Posted 19 Dec 2002 22:43:13
1
has voted
19 Dec 2002 22:43:13 Robert Kruse posted:
I've been trying to get my radio button to reset the chosen option in a dropdown menu. My radio button calls the following function:function CanShirt(form) {{
form.Colors.selectedIndex = form.Colors.options[-1];
}}
My radio button:
<input type="radio" name="radiobutton" value="T-Shirt" onclick="CanShirt(this.form)">
Am I on the right track, cause this doesn't work?
Thanks,
Bob
Replies
Replied 08 Jan 2003 12:08:19
08 Jan 2003 12:08:19 Dan The Man replied:
<b><font size=6>why the fuck do you have to post the same fuckin question twice ???</font id=size6></b>
Edited by - ANIMESHRINE1134 on 08 Jan 2003 12:11:56
Edited by - ANIMESHRINE1134 on 08 Jan 2003 12:11:56
Replied 08 Jan 2003 14:55:34
08 Jan 2003 14:55:34 Robert Kruse replied:
Maybe it was an accident, jerkoff. Are you that much of a loser that you have nothing better to do in life than to complain about stupid shit like this?
Replied 19 Jan 2003 12:25:05
19 Jan 2003 12:25:05 tim jamers replied:
<html>
<head>
<title></title>
<script language="javascript">
function choice(TheForm) {
TheForm.dropdownval.value = TheForm.colors[TheForm.colors.selectedIndex].text
}
function reset(TheForm) {
TheForm.colors.selectedIndex = TheForm.colors[0]
}
</script>
</head>
<body>
<form>
<p>
<select size="1" name="colors" onchange="choice(this.form)">
<option>Select color</option>
<option>Black</option>
<option>Blue</option>
<option>Red</option>
<option>White</option>
</select>
</p>
<p>
<input type="radio" name="R1" value="reset" onClick="reset()">Click to reset your choice...<br>
- Your Selection: <input type="text" name="dropdownval" size="40" value="Make your choice from the dropdown menu." onfocus="this.blur()">
</p>
</body>
</html>
That should do the trick <img src=../images/dmxzone/forum/icon_smile_big.gif border=0 align=middle> ...
enjoy!
Edited by - gangsta on 19 Jan 2003 12:27:32
<head>
<title></title>
<script language="javascript">
function choice(TheForm) {
TheForm.dropdownval.value = TheForm.colors[TheForm.colors.selectedIndex].text
}
function reset(TheForm) {
TheForm.colors.selectedIndex = TheForm.colors[0]
}
</script>
</head>
<body>
<form>
<p>
<select size="1" name="colors" onchange="choice(this.form)">
<option>Select color</option>
<option>Black</option>
<option>Blue</option>
<option>Red</option>
<option>White</option>
</select>
</p>
<p>
<input type="radio" name="R1" value="reset" onClick="reset()">Click to reset your choice...<br>
- Your Selection: <input type="text" name="dropdownval" size="40" value="Make your choice from the dropdown menu." onfocus="this.blur()">
</p>
</body>
</html>
That should do the trick <img src=../images/dmxzone/forum/icon_smile_big.gif border=0 align=middle> ...
enjoy!
Edited by - gangsta on 19 Jan 2003 12:27:32