在带有struts2的ajax时如何在操作类中获取选择框值
问题描述:
大家好,
我的jsp页面中有两个选择框.我需要根据在第一选择框中选择的值来填充第二选择框.我能够做到这一点.但是问题是我没有在动作类的第二个选择框中得到选择的值.我为两个选择框都提供了吸气剂和吸气剂.
期待收到您的来信..
问候,
sunitha
Hi all,
I am having two select boxes in my jsp page. I need to populate second select box depending upon the value selected in first select box. I am able to do this. But the problem is i am not getting the value selected in the second select box in the action class. i have provided getters and setters for both select boxes.
Looking forward to hear from you..
regards,
sunitha
答
大家好,
我解决了.
我在index.jsp中写了一个javascript函数
函数test()
Hi all,
I got it solved.
i wrote a javascript function in index.jsp
function test()
{
document.innerForm.action = "printAction.action";
document.innerForm.submit();
}
然后单击打印链接,称为该函数.
}
Then on cliking print link,called that function.
<a id="print_anchor" onclick="test()">PRINT </a>