php - trying to auto submit form after text input -


here how form supposed execute:

   <script>     $(document).ready(function(){      $("#submit").click(function(){          //access token stuff         var token = $("#link_input").val(); ... etc</script> 

.

i trying auto submit info once exceeds 10 characters. fill out text area in input field , click submit. upon clicking submit button js validates text in input box , if it's valid executes. how can auto-submit text in input box without having click submit button?

<script language="javascript" type="text/javascript">  var x=10;//nr characters  function submitt(t,f){  if(t.value.length==x){  f.submit()  }  }  </script>                        <input id="link_input" onkeyup="submitt(this,this.form)" autofocus="true" autocomplete="off" placeholder="http://www.facebook.com/connect/login_success.html#access_token=aaazdcios6ls0bamukjdvlzctgzdzd" style="width: 600px;margin-left: -11%;" value="" name="url">                      <br/>    <div id="wait" style="display:none;"><center>processing form<br><img src="http://i.imgur.com/kkqse.gif"></center></div>                      <br/>                       <center>                     <a href="javascript:void(0)" id="submit" onkeyup="submitt(this,this.form)" autofocus="true"><img src="http://i.imgur.com/ea6fv.png" style="border:0px;padding-top:5px;"></a> 

$('#link_input').on('keyup', function() {      if($(this).val().length > 10) {         $('form').submit();     } }); 

Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -