我收到的错误消息如下:
jquery.min.js:6 POST http://localhost:8000/etl/ 500 (Internal Server Error)send @ jquery.min.js:6ajax @ jquery.min.js:6(anonymous function) @ (index):763dispatch @ jquery.js:5087elemData.handle @ jquery.js:4895ListPicker._handleMouseUp @ about:blank:550
jquery.min.js:6 XHR finished loading: POST "http://localhost:8000/etl/".send @ jquery.min.js:6ajax @ jquery.min.js:6(anonymous function) @ (index):763dispatch @ jquery.js:5087elemData.handle @ jquery.js:4895ListPicker._handleMouseUp @ about:blank:550
昨天的代码工作得很好。我不知道哪里出了问题。
JS代码:
<script>
var $outTable = $('#etl_outTable');
$outTable.change(function() {
$('#etl_outField').attr("disabled",true);
var $form = $(this).closest('form');
var data = {};
data[$outTable.attr('name')] = $outTable.val();
$.ajax({
url : $form.attr('action'),
type: $form.attr('method'),
data : data,
success: function(html) {
// Replace current position field ...
$('#etl_outField').replaceWith(
// ... with the returned one from the AJAX response.
$(html).find('#etl_outField')
);
$('#etl_outField').attr("disabled",false);
}
});
});
</script>
我在做http://symfony.com/doc/current/cookbook/form/dynamic_form_modification.html#dynamic-generation-for-submitted-forms 希望得到一些帮助!谢谢!