LocalHero
05-30-2005, 09:07 PM
I thought I knew what I was doing, but I can't figure out how to make this JS work:
<HTML>
<HEAD>
<TITLE>Untitled Document</TITLE>
<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<SCRIPT type="text/javascript">
function size() {
if (document.forms.form1.radiobutton.selected==Height) {document.forms.textfield.value="Height"};
if (document.forms.form1.radiobutton.selected==Width) {document.forms.textfield.value="Width"};
}
</SCRIPT>
</HEAD>
<BODY>
<FORM name="form1" method="post" action="">
<INPUT name="radiobutton" type="radio" value="Height" onFocus="size();">
Height <INPUT name="radiobutton" type="radio" value="Width" onFocus="size();">
Width
<INPUT type="text" name="textfield">
</FORM>
</BODY>
</HTML>
I just want to display either "width" or "height" in the box. I thought I knew how to do it with checkboxes, but I'm missing something.
<HTML>
<HEAD>
<TITLE>Untitled Document</TITLE>
<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<SCRIPT type="text/javascript">
function size() {
if (document.forms.form1.radiobutton.selected==Height) {document.forms.textfield.value="Height"};
if (document.forms.form1.radiobutton.selected==Width) {document.forms.textfield.value="Width"};
}
</SCRIPT>
</HEAD>
<BODY>
<FORM name="form1" method="post" action="">
<INPUT name="radiobutton" type="radio" value="Height" onFocus="size();">
Height <INPUT name="radiobutton" type="radio" value="Width" onFocus="size();">
Width
<INPUT type="text" name="textfield">
</FORM>
</BODY>
</HTML>
I just want to display either "width" or "height" in the box. I thought I knew how to do it with checkboxes, but I'm missing something.