You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Udaya Allu <ua...@register.com> on 2003/12/11 16:17:17 UTC

problem in javascript for select enabled/disabled by checkbox in a list with in logic iterate

Hi All,
Please help me on 
select enabled/disabled by checkbox in a list with in logic iterate
I am not able to pass the index for disableing select box basing on check box enale/disable
please look at  the code part      onclick="this.form.subscriptions['<%=index %>'].selectedWalletItemId.disabled=this.checked?false:true;"
in the following code.
I tried it different ways ...but no success.
Other wise also if  I want to use simple onclick=" sumbit()", to do something action class and refresh,
I do not know how to pass the index or other parameters through 
Any amount of help is really appreciated as this is code in production.
Thank you
-Udaya Allu
<logic:iterate name="safeRenewForm" property="subscriptions" id="subscriptions" indexId="index">
<td>
	<html:select name="subscriptions" property="selectedWalletItemId" indexed="true" onchange="alert(this.name);">
		<html:option value="Select Credit Card">Select Credit Card</html:option>
		<logic:iterate id="idx" name="safeRenewForm" property="walletItems" indexId="index" >
			<bean:define id="blah" name="idx" property="walletItemID"/>
			<html:option value="<%= "" + blah %>">
				<b><bean:write name="idx" property="tender.cardType.cardName"/></b>
			   xxxx-<bean:write name="idx" property="tender.last4Digits"/>&nbsp;
				<bean:write name="idx" property="tender.expMonth" />/<bean:write name="idx" property="tender.expYear"/>
			</html:option>
		</logic:iterate>

    </html:select>
</td>
<td align="center"><html:checkbox name="subscriptions" property="statusEnabled" indexed="true" onclick="this.form.subscriptions['<%=index %>'].selectedWalletItemId.disabled=this.checked?false:true;"/></td>
 <logic:iterate>


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


Re: problem in javascript for select enabled/disabled by checkbox in a list with in logic iterate

Posted by Firat TIRYAKI <fi...@pleksus.com.tr>.
Well, sorry but you can't use the disabled property for one of a select
element's options, you can use it for the whole select.

F.

----- Original Message ----- 
From: "Udaya Allu" <ua...@register.com>
To: <st...@jakarta.apache.org>
Sent: Thursday, December 11, 2003 5:17 PM
Subject: problem in javascript for select enabled/disabled by checkbox in a
list with in logic iterate


Hi All,
Please help me on
select enabled/disabled by checkbox in a list with in logic iterate
I am not able to pass the index for disableing select box basing on check
box enale/disable
please look at  the code part
onclick="this.form.subscriptions['<%=index
%>'].selectedWalletItemId.disabled=this.checked?false:true;"
in the following code.
I tried it different ways ...but no success.
Other wise also if  I want to use simple onclick=" sumbit()", to do
something action class and refresh,
I do not know how to pass the index or other parameters through
Any amount of help is really appreciated as this is code in production.
Thank you
-Udaya Allu
<logic:iterate name="safeRenewForm" property="subscriptions"
id="subscriptions" indexId="index">
<td>
<html:select name="subscriptions" property="selectedWalletItemId"
indexed="true" onchange="alert(this.name);">
<html:option value="Select Credit Card">Select Credit Card</html:option>
<logic:iterate id="idx" name="safeRenewForm" property="walletItems"
indexId="index" >
<bean:define id="blah" name="idx" property="walletItemID"/>
<html:option value="<%= "" + blah %>">
<b><bean:write name="idx" property="tender.cardType.cardName"/></b>
   xxxx-<bean:write name="idx" property="tender.last4Digits"/>&nbsp;
<bean:write name="idx" property="tender.expMonth" />/<bean:write name="idx"
property="tender.expYear"/>
</html:option>
</logic:iterate>

    </html:select>
</td>
<td align="center"><html:checkbox name="subscriptions"
property="statusEnabled" indexed="true"
onclick="this.form.subscriptions['<%=index
%>'].selectedWalletItemId.disabled=this.checked?false:true;"/></td>
 <logic:iterate>


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



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