jquery - IE9 Form submits after mutiple click -
i have simple html form not submitting in ie9. works in chrome, ff, , ie10.
steps:
- click on "add files" button
- add multiple files.
- follow step 1 , step 2 (twice)
- click submit
if click "submit" load same page.
it's working on chrome, ff , ie10. in ie9 need click "submit" button multiple times based on how many times clicked "add files" button.
anyone can me identify wrong ? here form:
code:
form:
<form id="edit-object-form" name="multipleupload" class="main-form" action="" method="post" enctype="multipart/form-data" > <input type="button" id="add-file-field" name="add" value="add files" /> <div id="inputswrapper"></div> <input type="submit" class="regular-btn-red submit_button" value="submit query" id="submit" /> </form>
js:
$(function() { var inputswrapper = $("#inputswrapper"); //input file wrapper id var addbutton = $("#add-file-field"); //add button id var fieldcount=1; //to keep track of input file added // add browse button $(addbutton).click(function (e) //on add input button click { fieldcount++; //text box added increment //add input box <label for="myfile">** label **</label><br/> $(inputswrapper).append('<input class="custom_input" type="file" name="file[]" multiple id="multiupload'+fieldcount+'">'); document.getelementbyid("multiupload"+fieldcount).click(); return false; }); })(jquery);
Comments
Post a Comment