File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes <s:select onchange= not working" title="" /> Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "<s:select onchange="changeAmt()"> not working" Watch "<s:select onchange="changeAmt()"> not working" New topic

<s:select onchange="changeAmt()"> not working

Mamata Chaudhari

Joined: Apr 26, 2009
Posts: 23
I am using struts 2..
I want tabs on my jsp
and my code is..
On first Jsp i used to create tabs which works fine for me.

<s:tabbedPanel id="test" labelposition="middle" >
<s:iterator value="teamlist">
<s:url id="resultsUrl" action="navigateChangeTeamAction.action" >
<s:param name="teamCode" value="teamCode" />
<s:param name="teamName" value="teamName"></s:param>
<s:div label="Team2" theme="ajax" labelposition="center" href="%{resultsUrl}">

after executing navigateChangeTeamAction.action
now on my tabbed jsp code is as...

<s:select name="teamEmpNameCombo"
listValue="employeeName" headerKey="1" headerValue="Select" multiple="true"
onchange="select(this.form);" theme="simple" >

but onchage javascript function select() not called. not giving any error.
if i put alert("Hi"); instead of select() it gives me alert message.

Please help me?? I don't know why my javascript function is not getting call??
Ankit Garg

Joined: Aug 03, 2008
Posts: 9462

Mamata I think you should provide the code for your javascript method here so that we can see it. Also try to debug the method either using any tool like firebug or putting alert messages inside the method (like as the first statement) to see if the method is getting called. Also I've never used this tag before so can you please check the source of the generated page to see if this tag renders frames in the generated page in the browser...

SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
David Newton

Joined: Sep 29, 2008
Posts: 12617

And please UseCodeTags.
I agree. Here's the link:
subject: <s:select onchange="changeAmt()"> not working
It's not a secret anymore!