다음 양식을 보내야하는 데이터가 있습니다.양식이 포함되지 않은 jquery UI 대화 상자에서 양식을 보내는 방법
<form action="http://localhost/sp/index.php/daily_operation/turn_close" method="post" accept-charset="utf-8" id="form" name="form" class="form_cash"><br /> <input type="hidden" id="total_amount" name="total_amount" value="0">
<div>
<fieldset class="fieldset">
<legend>Billetes</legend>
<div class="row_form_div">
<label for="hundred_amount">100</label>
<input type="text" id="hundred_amount" name="hundred_amount" class="billet"/>
<input type="hidden" id="hundred_denomination_id" name="hundred_denomination_id" value="1">
</div>
<div class="row_form_div">
<label for="fith_amount">50</label>
<input type="text" name="fith_amount" id="fith_amount" class="billet"/>
<input type="hidden" id="fith_denomination_id" name="fith_denomination_id" value="2">
</div>
<div class="row_form_div">
<label for="twenty_amount">20</label>
<input type="text" name="twenty_amount" id="twenty_amount" class="billet"/>
<input type="hidden" id="twenty_denomination_id" name="twenty_denomination_id" value="3">
</div>
<div class="row_form_div">
<label for="ten_amount">10</label>
<input type="text" name="ten_amount" id="ten_amount" class="billet"/>
<input type="hidden" id="ten_denomination_id" name="ten_denomination_id" value="4">
</div>
<div class="row_form_div">
<label for="five_amount">5</label>
<input type="text" name="five_amount" id="five_amount" class="billet"/>
<input type="hidden" id="five_denomination_id" name="five_denomination_id" value="5">
</div>
<div class="row_form_div">
<label for="one_amount">1</label>
<input type="text" name="one_amount" id="one_amount" class="billet"/>
<input type="hidden" id="one_denomination_id" name="one_denomination_id" value="6">
</div>
</fieldset>
</div>
</form>
양식을 보내기 전에 양식의 데이터가 필요합니다.
$("#dialog-confirm").dialog({
resizable: false,
autoOpen:false,
height:150,
width:340,
open:false,
modal: true,
buttons: {
"No": function() {
$(this).dialog("close");
},
"Si": function() {
$("#form").submit();
$(this).dialog('close');
}
}
}
});
이 형태 만의 속삭임에 게시 된 데이터를 전송하는 목적으로이다 : 나는 나는 다음과 같은 jQuery 코드로 호출하는 조건
<div id="dialog-confirm" title="¿Cerrar turno con diferencia?">
<p><span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;">
</span>El desglose insertado no coincide con el total por concepto de operaciones. Esto significa que cerrará el turno con diferencia.
¿Está seguro?</p>
</div>
을 요청하는 JQuery와 UI 대화 상자를 구축 일어난다.
또한 아약스
"Si": function() {
$("#form").submit();
if (true) {
{
$.ajax({
type: "POST",
dataType: "json",
url: 'daily_operation/turn_close',
data: $("#form").serialize(), // serializes the form's elements.
success: function(data)
{
},
error: function(data) {
bValid = false;
}
});
}
$(this).dialog('close');
}
}
이 작업을 수행하려고하지만 아무것도 보내지 않고 남아있다.
도와 주시겠습니까?
나는 그것이 AJAX에 의해 데이터를 보내고있는 것을 볼 수있다. 이제는 같은 페이지에 남아 있기 때문에 게시물을 보낸 후에로드해야하는 페이지를로드하기 만하면됩니다. 고마워요. – Caleb
하지만 메서드 성공이 호출되지 않는다고 말하는 것입니까? 귀하의 요청에 다시 나오는 것을보기 위해 방화 녀석을 사용하십시오. AJAX를 사용하고 있다면 전체 페이지를 새로 고침 할 필요없이 html의 일부만 업데이트하면됩니다. 그러나 당신은 당신이 성취하고자하는 것을 알아야합니다. –