That was the first thing I tried but unfortunately does not work! -----Original Message----- From: Anil Kumar Pippalapalli [mailto:[EMAIL PROTECTED] Sent: 18 April 2006 10:49 To: Struts Users Mailing List Subject: Re: referencing variable in onclick event of html:link tag
hi, may be you can try removing the double quotes from the expression [<%=count%>]. bye "Shoukat, Faisal" <[EMAIL PROTECTED]> wrote: Can anyone help with explaining to me how to get a scriptlet into a html:linl tag in the onclick event. For example: I have two forms of the same name in my jsp page. The way I am submitting the forms is to call the onclick event within the html:link tag as follows: paramName="app" paramProperty="appId" onclick='javascript:document.forms.applicationDetailsForm[0].submit();'>[Sub mit] However where I have this: document.forms.applicationDetailsForm[0].submit(); 0 could be anything up to 10. I am within a logic:iterate tag so have declared the indexId as index. The problem I am having is how do I get index into the square brackets of the document.forms.applicationDetailsForm[0].submit(); so what I want to say is document.forms.applicationDetailsForm[index].submit(); I have tried the following none of which work: document.forms.applicationDetailsForm[<%=index%>].submit(); document.forms.applicationDetailsForm[<%="index"%>].submit(); document.forms.applicationDetailsForm["<%=index%>"].submit(); I also tried assigning it to a scriplet variable and using this but it did not work. <% int count = index.intValue(); %> document.forms.applicationDetailsForm["<%=count%>"].submit(); Can anyone advise on how to get the index variable into the square brackets. Thanks --------------------------------- Jiyo cricket on Yahoo! India cricket Yahoo! Messenger Mobile Stay in touch with your buddies all the time. ---------------------------------------------------------------------------- -------- The Northgate IS Content Screening and Inspection system has scanned this message for malicious and inappropriate content and none was found. Please take care when opening attachments even when these are expected and from known and trusted sources. ---------------------------------------------------------------------------- -------- --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]