Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery page changes then changes back
    primarykey
    data
    text
    <p>In jQuery, I have a form that submits, grabs data from a database using ColdFusion, and then displays some of that data on a new page. Problem is, whenever I switch to the new page, it flashes on for a second, and then redirects me back to the start page. <a href="http://psc.carthage.edu/tests/yup.html#permit" rel="nofollow">Here</a> is the page in question. Just type in 9355 as the permit number you want to search for.</p> <p>Here is the code behind it:</p> <p><strong>Permit Page</strong></p> <pre><code> &lt;div data-role="page" id = 'permit' data-add-back-btn="true"&gt; &lt;div data-role="header"&gt; &lt;h1&gt;Parking Permit Number Search&lt;/h1&gt; &lt;/div&gt;&lt;!-- /header --&gt; &lt;div data-role="content"&gt; &lt;div class="ui-grid-solo"&gt; &lt;div class="ui-block-a"&gt;&lt;br&gt;&lt;/div&gt; &lt;div class="ui-block-a"&gt; &lt;form id="formpermit"&gt; &lt;input type="text" data-clear-btn="true" name="permittext" id="permittext" value=""&gt; &lt;/form&gt; &lt;/div&gt; &lt;script type="text/javascript"&gt; $("#formpermit").on("submit",function() { $.mobile.changePage("#Student"); }); &lt;/script&gt; &lt;div class="ui-block-a"&gt; &lt;!-- &lt;a href='#Student' data-role="button" onclick="formpermit.submit()" data-inline="true"&gt;Search&lt;/a&gt; --&gt; &lt;/div&gt; &lt;/div&gt;&lt;!-- /grid solo --&gt; &lt;/div&gt;&lt;!-- /content --&gt; &lt;a href='#bug' data-rel="dialog" onclick="clearText()" data-close-btn="left" data-role="button" data-inline="true"&gt;Report bug&lt;/a&gt; &lt;/div&gt; &lt;!--/Permit Number --&gt; </code></pre> <p><strong>Student Page</strong></p> <pre><code>&lt;div data-role="page" id = 'Student' data-add-back-btn="true"&gt; &lt;div data-role="header"&gt; &lt;h1&gt;Student Info Page&lt;/h1&gt; &lt;/div&gt;&lt;!-- /header --&gt; &lt;div data-role="content"&gt; &lt;script type="text/javascript"&gt; $("#formpermit").on("submit",function() { var strPermit=$(permittext).val(); strPermit=$.trim(strPermit); $.get("joeyP.cfm", { Permit: strPermit}) .done(function(data) { $("#myResults").html(data); }); }); &lt;/script&gt; &lt;div id="myResults"&gt;&lt;/div&gt; &lt;/div&gt; &lt;!-- /content --&gt; &lt;a href='#first' data-role="button" data-inline="true"&gt;Back&lt;/a&gt; &lt;/div&gt; &lt;!--/Student --&gt; </code></pre> <p>Thanks in advance!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload