I've seen other similar issues here that have found solutions but after trying them, none work on my case.
I am submitting a form using JQuery Mobile.
After I submit I get a loading message and nothing else.
Does anyone have any ideas?
Here is the relevan code:
in the head:
<!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>
Then the form:
<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>
Note: I've added an Echo on the action page but it never gets there.
Any ideas anyone please?
Thanks
jquery mobile use ajax in passing forms, just turn it off and you're good to go
<form action="form1" method="post" data-ajax="false">
Does your "checklogin.php" file have any <div data-role="page">
tag? If you expect it to load "checklogin.php", then that php file should have some HTML that jQuery mobile recognizes. It will then pull it into your page. If you check your network response to the POST request for "checklogin.php" you will probably see your echo there, but it won't show on the page. Try it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With