Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I have the same but I use their validation and <a href="http://web.enavu.com/tutorials/checking-username-availability-with-ajax-using-jquery/" rel="nofollow">this</a> to check if username exists. It works great.</p> <pre><code>&lt;script type="text/javascript" src="../js/jquery.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function() { //the min chars for username var min_chars = 3; //result texts var characters_error = 'username must have atleast 3 characters'; var checking_html = 'searching...'; //when button is clicked $('#check_username_availability').click(function(){ //run the character number check if($('#username').val().length &lt; min_chars){ //if it's bellow the minimum show characters_error text $('#username_availability_result').html(characters_error); }else{ //else show the cheking_text and run the function to check $('#username_availability_result').html(checking_html); check_availability(); } }); }); //function to check username availability function check_availability(){ //get the username var username = $('#username').val(); //use ajax to run the check $.post("checkuser.php", { username: username }, function(result){ //if the result is 1 if(result == 1){ //show that the username is available $('#username_availability_result').html('&lt;span class="is_available"&gt;&lt;b&gt;' +username + '&lt;/b&gt; is available&lt;/span&gt;'); //this is the id of my save button it'll display if available $('#newacct').css("display", "inline"); }else{ //show that the username is NOT available $('#username_availability_result').html('&lt;span class="is_not_available"&gt;&lt;b&gt;' +username + '&lt;/b&gt; is not available&lt;/span&gt;'); } }); } &lt;/script&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.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      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