struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Odelya YomTov" <ode...@jpost.com>
Subject disabling html:select and html:text by the value in another html:select
Date Thu, 16 Jul 2009 17:14:26 GMT
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


Mime
View raw message