javascript - Input field with onchange fails to trigger when user click button in another form -


i have page multiple small forms on it. each form has 1 input field has onchange function submit it's form url returns no data status.

things work fine, sutmitting form after form, until user clicks on small form has submit button in it. click works, but abandons change in previous field resulting in onchange not firing click @ bottom of changed function fails (still trying understand firebug trace).

what's going on? there fix structure?

update:

first tried delaying action of submit, no luck.

i have hidden , added chain of "events" focus has place come rest before real submit tries happen -- code below has been updated. question becomes:

is simple can be?


script:

$(function() {   $('input,select').change(changed); }); function changed(){   ...    $(this).parents('form').find(':submit').click(); } function dosubmit(elt, id) {   $(elt).focus();   settimeout(function(){       $(id).click();     }, 400); } 

one of may small forms:

<form class="clean" method="post" action="quoteproapp.php">   <input type="submit" value="field" name="btn_update" style="display: none;">   <input type="hidden" value="000242" name="quote_id">   <input type="text" maxlength="15" size="3" value="" name="q[cost][4][1][unit]"> </form> 

the offending click goes form:

<form class="clean" method="post" action="quoteproapp.php">   <input type="hidden" value="000242" name="quote_id">   <input type='button' name='btn_close' value='close' onclick='dosubmit(this,"#close");'>   <input id='close' type='submit' name='btn_close' value='close' style='display:none;'> </form> 

might totally irrelevant, selector change event includes submit input too. can change to:

 $('input[type="text"],select').change(changed); 

to see if changes?


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -