我在这里看到了其他类似的问题,并找到了解决方案,但在尝试之后,没有一个对我的案例起作用。
我正在使用 JQuery Mobile 提交表单。
提交后,我收到一条加载消息,但没有其他消息。
有人有什么想法吗?
相关代码如下:
在头部:
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a4.1/jquery.mobile-1.0a4.1.min.css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.5.2.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/mobile/1.0a4.1/jquery.mobile-1.0a4.1.min.js"></script>
<script>
//reset type=date inputs to text
$( document ).bind( "mobileinit", function(){
$.mobile.page.prototype.options.degradeInputs.date = true;
});
</script>
</head>
然后是表格:
<form name="form1" method="post" rel="external" action="checklogin.php">
<div class="ui-field-contain ui-body ui-br" data-role="fieldcontain">
<label class="ui-input-text" for="name">Username:</label>
<input name="myusername" id="myusername" value="" type="text">
</div>
<div class="ui-field-contain ui-body ui-br" data-role="fieldcontain">
<label class="ui-input-text" for="name">Username:</label>
<input name="mypassword" id="mypassword" value="" type="text">
</div>
<fieldset class="ui-grid-a">
<div><input value="" name="" type="hidden"><button aria-disabled="false" class="ui-btn-hidden" type="submit" data-theme="a">Login</button></div></div>
</fieldset>
</form>
注意:我在操作页面上添加了 Echo,但它永远不会到达那里。
请问大家有什么想法吗?
谢谢
最佳答案
jquery mobile 在传递表单中使用 ajax,只需将其关闭即可开始
<form action="form1" method="post" data-ajax="false">
关于JQuery 移动表单提交不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5770276/