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> Quote 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.. Quote 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. Quote Link to comment https://forums.phpfreaks.com/topic/260350-override-form-submit/#findComment-1334410 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.