Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I assume the 'go' button only works for submitting <a href="http://www.w3schools.com/html/html_forms.asp" rel="nofollow">forms</a>.</p> <p>I do not see a form in your html.</p> <pre><code>&lt;form onsubmit="userLogin()"&gt; &lt;label&gt;username&lt;/label&gt; &lt;input type="text" name="username" /&gt; &lt;label&gt;password&lt;/label&gt; &lt;input type="password" name="password" /&gt; &lt;input type="submit" value= "submit"&gt;submit my form&lt;/form&gt; &lt;/form&gt; </code></pre> <hr> <p><strong>Edit</strong></p> <p>I have a working example: <a href="http://jsbin.com/IgeHUdEz/edit" rel="nofollow">http://jsbin.com/IgeHUdEz/edit</a> I have stripped the HTML somewhat, but please note at how you should use labels with the for attribute.</p> <p><em>HTML</em></p> <pre><code>&lt;div data-role="page" id="page_login"&gt; &lt;form id="loginform" name="login"&gt; &lt;!--form submit--&gt; &lt;label class="input" for="input_usersername"&gt; &lt;span&gt;Username&lt;/span&gt; &lt;/label&gt; &lt;input type="text" id="input_usersername"&gt; &lt;label class="input" for="input_password"&gt; &lt;span&gt;Password&lt;/span&gt; &lt;/label&gt; &lt;input type="number" id="input_password"&gt; &lt;div style="text-align:center; margin-top:37px"&gt; &lt;div class="main_button" id="login_button"&gt; &lt;input type="submit" value="Login" id="btnSubmit" data-role="none"/&gt; &lt;/div&gt; &lt;/div&gt; &lt;/form&gt; &lt;/div&gt; </code></pre> <p><em>Javascript</em></p> <pre><code>$("#loginform").on( 'submit', function(event) { userLogin(); }); function userLogin() { alert($('#input_usersername').val() + " - " + $('#input_password').val()); } </code></pre>
    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.
 

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