jquery submit one form when page has more than one form -
i have page 2 forms. id="form2" , id="form3".
form3 within form2. inside form3, there button jquery action submit form3 when click on it, nothing happens.
this written in classic asp , jquery.
this form2
<form id="form2" name="form2" method="post" action="process/processeditjob.asp"> and within this, there following form:
<form id="form3" method="post" enctype="multipart/form-data" action="uploadscript1.asp"> <input type="file" size="40" name="file1"><br /> <input id="goupload" type=submit value="upload!"> </form> the jquery linked button follows:
$('#goupload').on("click", function(e) { e.preventdefault(); alert("entered"); $('#form3').attr('action', "uploadscript1.asp").submit(); }); when click on button, can see alert message saying entered.
if move form3 new page, works perfectly.
i not sure why not submitting within first form.
thanks saj
Comments
Post a Comment