Note that there are some explanatory texts on larger screens.

plurals
  1. POSUBMIT FORM with mouse clicking and enter button
    primarykey
    data
    text
    <p>I am Submiting form through MOUSE CLICK and ENTER too.</p> <p>Ajax Call is checking is there any designation which i already in DATABASE.. If not, user can submit form otherwise SUBMIT button will DISABLE</p> <p>JQUERY</p> <pre><code>function check_designation(e){ text = $('#req1').val(); data = "data=" + text; text_length = text.length if(text_length == 0) { $('#result_span').html(''); } if(text_length &gt; 3 ){ $.ajax({ url: "designation_ajax.php", type: "POST", data: data, cache: false, success: function (response) { if ($.trim(response) == "access") { $("#result_span").html('&lt;div class="green"&gt;' + text + ' is available '+'&lt;/div&gt;'); $('#create_desg').removeAttr('disabled'); } else if ($.trim(response) == "no access") { $("#result_span").html('&lt;div class="red"&gt;' + text + ' is already in use'+'&lt;/div&gt;'); $('#create_desg').attr('disabled','disabled'); } else { alert('Sorry, unexpected error. Please try again later.'); } } }); } else{ $("#result_span").html(''); } return true; } </code></pre> <p>HTML FORM</p> <pre><code>&lt;form id="formID" class="formular" method="POST" action="" onsubmit="formSubmit()" &gt; &lt;fieldset&gt; &lt;legend&gt;Create Desination&lt;/legend&gt; &lt;label&gt; Designation&lt;br clear="all" /&gt; &lt;input autocomplete="off" onkeyup="check_designation(event)" value="" class="validate[required,minSize[4]] text-input float_left" type="text" name="name" id="req1" /&gt; &lt;span id="result_span"&gt;&lt;/span&gt; &lt;/label&gt; &lt;br clear="all" /&gt; &lt;input id="create_desg" value="Submit" type="button" /&gt; &lt;/fieldset&gt; &lt;/form&gt; </code></pre> <p>PROBLEM::::</p> <p>Now what happen DISABLE button is not a solution... if there is already a DESIGNATION in a table.. submit button will disable but By ENTER it will submitted and i dont want to reload the page. and AJAX is not working when i PRESS ENTER</p>
    singulars
    1. This table or related slice is empty.
    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