在带有struts2的ajax时如何在操作类中获取选择框值 [英] how to get select box value in action class when using ajax with struts2
本文介绍了在带有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>
这篇关于在带有struts2的ajax时如何在操作类中获取选择框值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文