Not sure, but this may be what you need: (change to your liking)

<form name="frm" action="somewhere.go" method="GET">

<script LANGUAGE="JavaScript">
function forceSelect(form, val, bDisabled){
        selectCtl = form.elements["something"];
        selectCtl.selectedIndex=val;
        selectCtl.disabled=bDisabled;
}

</script>
<br>
<input type="radio" name="myRadio" value="val1"
onClick="forceSelect(this.form, 0, false)">Val 1<br>
<input type="radio" name="myRadio" value="val2"
onClick="forceSelect(this.form, 1, true)">Val 2<br>

 <select name="something">
  <option value="">- Select One -</option>
  <option value="value1">value1</option>
  <option value="value2">value2</option>
  <option value="value3">value3</option>
 </select>
<input type="submit" name="submit" value="Submit">

</form>






--
James Mitchell
Software Engineer / Struts Evangelist
http://www.struts-atlanta.org
678.910.8017 (c)
770.822.3359 (h)
AIM:jmitchtx




> -----Original Message-----
> From: Jerry Jalenak [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, October 29, 2003 11:44 AM
> To: '[EMAIL PROTECTED]'
> Subject: [OT - JavaScript] Setting value on a <html:select/>
> 
> 
> Been screwing around with this all morning, and can't seem to find an
> answer.....
> 
> I've got two radio buttons on a form.  If the user clicks the 
> second radio
> button, I need to force the value of a following <html:select/> to a
> specific value, and disable the select.  So, using 
> JavaScript, on my radio
> button I fire an onclick event that run a real simple 
> javascript function.
> In this function I've tried using 
> 
>       document.formName.selectVar.value = <default value>     // is
> accepted, but the <default value> isn't passed to my form bean
>       document.formName.selectVar.option[0].selected = true   
> //  ditto
>       document.formName.selectVar.option[0].value = <default value>
> // ditto
>       document.formName.selectVar.option[0].isSelected = true 
>       //
> ditto
> 
> JavaScript seems to accept all of these formats, but the 
> setter method in my
> form bean for 'selectVar' is never getting called.  This is 
> going to be a
> 'Doh!' moment, but how do I do this?
> 
> TIA!
> 
> Jerry Jalenak
> Development Manager, Web Publishing
> LabOne, Inc.
> 10101 Renner Blvd.
> Lenexa, KS  66219
> (913) 577-1496
> 
> [EMAIL PROTECTED]
> 
> 
> This transmission (and any information attached to it) may be 
> confidential and
> is intended solely for the use of the individual or entity to 
> which it is
> addressed. If you are not the intended recipient or the 
> person responsible for
> delivering the transmission to the intended recipient, be 
> advised that you
> have received this transmission in error and that any use, 
> dissemination,
> forwarding, printing, or copying of this information is 
> strictly prohibited.
> If you have received this transmission in error, please 
> immediately notify
> LabOne at the following email address: 
> [EMAIL PROTECTED]
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to