簡體   English   中英

怎么獲得<s:button> Struts2 中的功能?</s:button>

[英]How to get <s:button> functionality in Struts2?

<s:form action="XYZ" method="post">
    <s:textfield name="sno" />
    <s:textarea name="t" rows="2" cols="4" />

    <!-- Here i want a button lets say -->
    <s:button value="GET TEXT" />

    <!--
        which executes other action (not "XYZ" ) and fill the textarea based on the serial no value(sno). 
    -->

    <s:submit  value="submit" />
</s:form> 

桌子

無文本


1“hsdjhjjsh”
2“jsdjh hj kjskjdhj”


提交表單時,它應該插入一個新行。 Action "XYZ"就是這樣做的。 但是,當我給現有的 sno 讓我們說“1”和 onclick GET TEXT按鈕時,它不應該提交表單,而是應該調用其他操作,用hsdjhjjsh填充 textarea。

謝謝

你不能使用普通的 HTML:輸入類型按鈕嗎?

如果您不想提交,它可能不需要任何 struts 功能。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM