私のページのデザインは、シングルクリックで送信してからデータベースに保存する 2 つのフォームを使用する必要があるようなものです。
これを Struts 2 Framework の JSP ページで使用しています。Ajax ソリューションを試してみましたが、うまくいきません。
これが私のスクリプトです(更新済み):
$("#visitType").buttonset();
$("#patientCondition").buttonset();
$("input[type=submit], a, button").button().click(function(event) {
event.preventDefault();
var inputs=$('#visitType,#patientCondition ').find(':input').not(this);
var form_data={};
inputs.each(function(){
form_data[this.name]=$(this).val();
});
$.post('patientSoapAll', form_data, function(response){
});
});
私のフォーム1:
<s:form action="PatientSoapAll" method="post">
<div id="visitType">
<input type="radio" id="I" value="I" <s:if test='pSB.rOS == "I"'>checked</s:if> name="pSB.rOS" /><label for="I">I V</label>
<input type="radio" id="R" value="R"<s:if test='pSB.rOS == "R"'>checked</s:if>name="pSB.rOS" /><label for="R">Regular Visit</label>
<input type="radio" id="P/N" <s:if test='pSB.rOS == "P/N"'>checked</s:if>name="pSB.rOS" /><label for="D/N">Re- Evaluation</label>
<input type="radio" id="D/N"<s:if test='pSB.rOS == "D/N"'>checked</s:if> name="pSB.rOS" /><label for="
P/N">Discharge</label>
</div>
</s:form>
私のフォーム2:
<s:form action="PatientSoapAll" method="post">
<div id="patientCondition">
<input type="radio" id="new" value="n"<s:if test='pSB.r2 == "n"'>checked</s:if> name="pSB.r2" /> <label for="new">New</label>
<input type="radio" id="noChange" value="nC" <s:if test='pSB.r2 == "nC"'>checked</s:if> name="pSB.r2" /><label for="noChange">No Change</label>
<input type="radio" id="progressing" value="p"<s:if test='pSB.r2 == "p"'>checked</s:if> name="pSB.r2" /><label for="progressing">Progressing</label>
<input type="radio" id="notProgressing" value="nP" <s:if test='pSB.r2 == "nP"'>checked</s:if> name="pSB.r2" /><label for="notProgressing">Not Progressing</label>
</div>
</s:form>
これは私の更新済み送信済みボタンです。テーブルから取り出し<div>
、テーブルの中に置いた。
<tr>
<td></td>
<td><input type="submit" value="Save Note" /></td>
</tr>
私は Struts 2 を使用しており、この送信ボタンをアクションにリダイレクトしたいと考えていますPatientSoapAll
。(デフォルトでは)の.do
代わりにカスタム拡張機能を使用しています。.action
この送信ボタンを Struts 2 のそれぞれのアクション クラスにリダイレクトする方法を教えてください。