내 페이지 디자인은 단 한 번의 클릭으로 제출 한 다음 데이터베이스와 부절로 저장하는 두 가지 양식을 사용해야하는 것과 같습니다. Struts2 프레임 워크가있는 JSP 페이지에서 이것을 사용하고 있습니다. Ajax 솔루션을 시도했지만 저를 위해 작동하지 않습니다.Ajax와 함께 단일 제출 버튼을 사용하여 JSP로 두 개의 HTML 양식 제출
$("#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>
내 Form2를 :
<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>
나는 스트럿츠 2를 사용하고 있는데, 나는 정의의 수도 있었죠의 확장 대신에 (기본적으로) .action을 사용하고이 액션 patientSoapAll에 버튼을 제출 리디렉션 할. 이 제출 버튼을 struts2의 해당 조치 클래스로 리디렉션 할 수있는 방법을 알려주십시오.
당신은 –
WTQ를 제출 배가 할 수 없습니다
버튼을 제출? 왜 두 가지 양식을 제출해야합니까? –
@RomanC : 페이지의 맨 위에 다른 세부 정보를 사용해야하는 표시 패턴과 jquery 탭 안에있는 다른 부분이 있으므로 또한 다양한 탭이 있으며 각 선택에 따라 다른 조합이 생깁니다. 탭 중 하나에서 선택한 것과 같은 항목을 선택하면 특별한 데이터베이스 항목이 나에게 표시됩니다. 희망은 지금 분명하다. – anshulankush