Note that there are some explanatory texts on larger screens.

plurals
  1. POdeny submitting form if the username exist on the mysql db
    primarykey
    data
    text
    <p>i just pluged a <code>JQuery username check</code> which worked fine , the problem is that my form still submitting even the username exist on my <code>Mysq Database</code>, how can i configure it to deny submitting to my <code>server side .php file</code> if it exists ?</p> <p>here is my Jquery plugin javascript code </p> <pre><code> $(document).ready(function() { //the min chars for checkusername var min_chars = 3; //result texts var characters_error = 'Minimum amount of chars is 3'; var checking_html = '&lt;img src="images/checkusername.gif" /&gt; Checking...'; //when button is clicked $('#check_checkusername_availability').click(function(){ //run the character number check if($('#checkusername').val().length &lt; min_chars){ //if it's bellow the minimum show characters_error text $('#checkusername_availability_result').html(characters_error); }else{ //else show the cheking_text and run the function to check $('#checkusername_availability_result').html(checking_html); check_availability(); } }); }); //function to check checkusername availability function check_availability(){ //get the checkusername var checkusername = $('#checkusername').val(); //use ajax to run the check $.post("frontend/functions/f_checkuser.php", { checkusername: checkusername }, function(result){ //if the result is 1 if(result == 1){ //show that the checkusername is available $('#checkusername_availability_result').html('&lt;span class="is_available"&gt;&lt;b&gt;' +checkusername + '&lt;/b&gt; is Available&lt;/span&gt;'); }else{ //show that the checkusername is NOT available $('#checkusername_availability_result').html('&lt;span class="is_not_available"&gt;&lt;b&gt;' +checkusername + '&lt;/b&gt; is not Available&lt;/span&gt;'); } }); } </code></pre> <p>here is my html field</p> <pre><code> &lt;table border="0" &gt; &lt;tr&gt; &lt;td valign="middle"&gt;&lt;input class="input_field_12em required userUserName" name="userUserName" id="checkusername"&gt;&lt;/td&gt; &lt;td valign="middle"&gt;&lt;input type='button' id='check_checkusername_availability' value='Check Availability'&gt;&lt;/td&gt; &lt;td&gt;&lt;div id='checkusername_availability_result'&gt;&lt;/div&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; </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