Submitting a Form using Jquery -


okay converting code jquery , js changing focus button target id using whenever press enter or double click in <select> tag. document.getelementbyid.focus() , document.getelementbyid.click() , returning true submit form. looking example on how same thing using jquery instead. understand there .keypress() , .dblclick() function in jquery , thats think should using passing values of input box or select values little difficult since there multiples of each in form. fyi search page sends sql oracle database. update-

$(document).ready(function(){     $('form').submit(function(){        $(this).keypress()          if(event.which ==13){            }     }); });    

this have far not sure if on right track or not. here example of how form is.

<form>  <tr>     <td nowrap="nowrap"><b>&nbsp;&nbsp;search number&nbsp;&nbsp;</b></td>     <td style="vertical-align:top"><input type="text" name="revisor_number"     value=revisor_number>" size="55" maxlength="100" /><br/><span style="font-size:75%">commas between numbers (10,15,20), dash range(10-20)</span><br/></td>     <td>&nbsp;&nbsp;<input type="submit" name="submit_number" id="submit_number" value="go"/></td>  </tr>  <tr> <td style="vertical-align:top" nowrap="nowrap"><b>&nbsp;&nbsp;search type&nbsp;&nbsp;</b></td> <td>     <select name="subtype[]" size="3" multiple="multiple" onkeypress="keypress(event, 'submit_subtype');" ondblclick="keypress(event, 'submit_subtype');">     <option value="">>--- ---</option>   <td style="vertical-align:top">&nbsp;&nbsp;<input type="submit" name="submit_subtype" id="submit_subtype" value="go"/></td> 

you need move outside of submit function, replace with:

$('input, textarea').keypress(function(e) {     if(e.which == 13) {         $(this).blur();     $('#submit').focus().click();     } }); 

assuming '#submit' id of button.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -