JQuery Mobile Form Submit Doesn't Work

I saw other similar problems here that found solutions, but after testing them, no one works on my case.

I submit a form using jQuery Mobile.

After sending, I get a download message and nothing more.

Does anyone have any ideas?

Here is the compliance 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 added Echo on the action page, but it never gets there.

Any ideas to anyone?

thank

+5
source share
4 answers

"checklogin.php" <div data-role="page">? , "checklogin.php" , php HTML, jQuery mobile. . POST "checklogin.php" , , , , . .

+5

jquery mobile ajax , ,

<form action="form1" method="post" data-ajax="false">

+15

, jQuery Mobile: CSS

:

jQMs visible wrapper element , , jQM css . , , "" , ! , .

, .

:

    $("#createButton").parent().click(function() {$("#createButton").click()});

, submit.

Obviously bad design in jQM. If they are going to “move” the decorations into a shell element, they must remove them from the wrapped element. There are many complaints that jQM does not file online, and I suspect that many of them are this problem.

+3
source

Use Javascript submit instead of Jquery submit, as this is a problem with jQuery mobile.

using

document.getElementById ("FormID") represents () ;.

instead

$ ("# FormID") represents () ;.

+3
source

All Articles