You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Odelya YomTov <od...@jpost.com> on 2009/07/16 19:14:26 UTC

disabling html:select and html:text by the value in another html:select

Hi!
i have these components:

<html:select name="orderBean" property="data.payingType"
onchange="javascript:disable();">
   <html:options name="orderBean" property="payingTypes" />
</html:select>
<html:select name="orderBean" property="data.payments">
    <html:options name="orderBean" property="paymentsList" />
</html:select>
<html:text maxlength="25" size="15" name="orderBean"
property="data.billToName" />

i would like that when the user chooses a specific value in data.payingType
- it would disable/enable the other html:select and html:text.
i wrote this function:

<script type="text/javascript">
function disable(){
	var sel = document.getElementsByName('data.billToName')[0];
	sel.options[sel.selectedIndex].value;

	alert(sel);
}

<script>

but i get an error:
sel.selectedIndex is undefined.
how can i do it please?

Thanks!



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org