function myfunction(var1) {
var params =var1; //values for passing to struts if any
var resultStringX = $.ajax({
type: "POST",
url:"loadImportAasthiPage1.action", // struts2 action call
data: params,
async: false
}).responseText;
// the returning result will be stored in resultStringX variable
resultStringX=$.trim(regn);
}
<s:form action="loadImportAasthiPage1">
<s:select label="What's your favor search engine" id="ward"
headerKey="-1" headerValue="Select Search Engines"
list="wardList"
name="wardNum"
value="wardNumber" onchange="myfunction(10)" />
Regn List
<s:select name="propertyId"
list="propertyList" listKey="propertyId"
id="regn" listValue="regnName"
headerKey="0" headerValue="--select--" />
</s:form>
String wardNum;
我获得了wardNum的空值。
请告诉我们如何将值从JavaScript传递给动作类