imperium2335 Posted April 4, 2012 Share Posted April 4, 2012 Hi, I am trying to create a file uploader by following an online tutorial about AJAX file uploading. Due to the nature of my system, I need to override the the form submit function. That is, instead of submit the form by pressing the typical form submit button, I want to submit the form using my function (which is a button in a jquery ui dialog box). How can I do this? ( I have attached a screenshot) Here is my form for the file upload part in the dialog: <form id="imageList" method="post" enctype="application/x-www-form-urlencoded" target="hiddenUpload"> <input name="firstFile" type="file" /> <iframe id="hiddenUpload" name="hiddenUpload" onload="" style="width:0px;height:0px;border:none;"></iframe> </form> Link to comment https://forums.phpfreaks.com/topic/260350-override-form-submit/ Share on other sites More sharing options...
AyKay47 Posted April 4, 2012 Share Posted April 4, 2012 Typically you'll return false on the submit button click and call .submit() on the form element in your function. Really can't help any further given a picture and a form.. Link to comment https://forums.phpfreaks.com/topic/260350-override-form-submit/#findComment-1334408 Share on other sites More sharing options...
imperium2335 Posted April 4, 2012 Author Share Posted April 4, 2012 Thanks! That is exactly what I wanted. I guess this is how they fake an AJAX file upload. Link to comment https://forums.phpfreaks.com/topic/260350-override-form-submit/#findComment-1334410 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.