You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Vernon Wu <ve...@gatewaytech.com> on 2002/10/03 03:41:55 UTC

How can I get a value from a Javascript for a formbean?

I have two selected lists in a form. The data in the second list will change accordingly when the selected item in the first 
list is changed. My question is how to get the second selected item for the formbean. I use a framworks similar with 
Struts. Here is the code segment:

  <select name="field01" onchange="SetField02()">
    <option <%= Pform.field01SelectionAttr("-1") %> value="-1">-1</option>
    <option <%= Pform.field01SelectionAttr("0") %> value="0">0</option>
    <option <%= Pform.field01SelectionAttr("1") %> value="1">1</option>
    <option <%= Pform.field01SelectionAttr("2") %> value="2">2</option>
  </select>
  <select name="field02">
	<option value="0" selected >--------</option> 
  </select>

<script language=javascript>

function SetField02(){
	//...	
	return ;
}

</script>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>