在我的应用程序的认可,我需要改变动态 我的代码下面给出的textfield
的内容:动态输入未在Struts2,jquery的标签
<script type="text/javascript">
$.subscribe('before', function(event, data) {
$('#text').val('Text Changed by jQuery');
});
</script>
<s:form id="form2" action="textchange" >
<s:textfield id="text" name="text" value="Hello World!!!"/>
<sj:submit targets="result" onBeforeTopics="before" />
</s:form>
我期待输出
Text Changed by jQuery
但我得到
Hello World!!!
我使用Struts2-jquery-plugin 3.5.1.
如何获取动态输出。
你在哪里得到旧值?在你的行动类或jsp本身? –
将'subscribe'放入文档就绪区块。 –
即时获取我的行为类中的旧值 – Hariprasath