javascript - How to not upload images / files upon form submit -
i have got simple form , upload images once main submit button pressed not upload images once button pressed? ideas? please see executing different action on form.
<form method="post" name="form" id="form" action="upload.php" enctype="multipart/form-data"> <input class="button_date" id="fileinputbox" style="margin-bottom: 5px;" type="file" name="file[]" extension="jpeg|jpg|png|gif|giff|tiff" required/> <input class="button2 cancel" style="border-right:none; font-size:13px;" name="back" id="back" type="submit" value="back" onclick="javascript: form.action='back.php';"/> <input class="button2" style="border-right:none; font-size:13px;" name="list item" id="submit" type="submit" value="list item" onclick="removefocus()"/> </form>
if disable input not submitted, see here more details values of disabled inputs not submited?
so add:
document.getelementbyid('fileinputbox').disabled = true;
ie
<input class="button2 cancel" style="border-right:none; font-size:13px;" name="back" id="back" type="submit" value="back" onclick="javascript:document.getelementbyid('fileinputbox').disabled = true; form.action='back.php';"/>
Comments
Post a Comment