hi..
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:url>
   <s:div label="Team2" theme="ajax" labelposition="center" href="%{resultsUrl}">
       </s:div>
   	</s:iterator>
</s:tabbedPanel>

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

<s:select name="teamEmpNameCombo" 
			 id="teamEmpNameCombo" 
                        list="teamEmployeelist" 
		 listValue="employeeName" headerKey="1"                     headerValue="Select"  multiple="true"     				   
	  cssStyle="width:130;font-size:15;" 
			   				  onchange="select(this.form);" theme="simple"  >
            </s:select>

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??

Post your code fragement in BB code. Check whether a select function is defined or not and if it there then post it so I can help you on that issue.

Post your code fragement in BB code. Check whether a select function is defined or not and if it there then post it so I can help you on that issue.

I have written that function on my tabbed jsp

Will you post javascript code?

Will you post javascript code?

I m giving just an alert("Hi" ) for checking prupose

function select(form)
{
           alert("Hi") ;
}

I am posting a sample page containing a javascript:

<script type="text/javascript">
   function select(form) {
    alert(form.test.value);
   }
</script>

<form name="form1" method="post">
<select name="test" onchange="select(this.form);">
 <option value="a">a</option>
 <option value="b">b</option>
</select>
</form>

i got solution.I moved my java scrpit code to first Jsp (which i used to create tabs).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.