Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

onclick function

Status
Not open for further replies.

aid919c

Programmer
Mar 3, 2005
1
US
Hi,
I am writing a form with radio buttons that as a action when it is clicked. If the user clicked "Yes" this javascript function is called. I have to given the "theDiv" unique numbers like "theDiv1", "theDiv2". So to call the "divs" I am call the ShowDiv(i) function by passing the value as shown below, but the int value is never passed instead when I view source it displays onclick="<%="ShowDiv("+i+")"%>">

<%int i = 1; %>
<html:radio property="healthBenefitsIndicator" indexed="true" value="N"

onclick="<%="ShowDiv("+i+")"%>">

</html:radio>

Can anyone help me out.
Thanks,
-Syed
 
<%int i = 1;
String tempStr = "ShowDiv("+i+")";
%>
<html:radio property="healthBenefitsIndicator" indexed="true" value="N"

onclick="<%=tempStr%>">

</html:radio>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top