imarockstar Posted November 13, 2008 Share Posted November 13, 2008 I have this little bit of code, its a form to upload an image. <form name="upload-form" id="upload-form" method="post" action="javascript:ajaxFunction('scripts/image_go.php')" enctype="multipart/form-data"> <input type="hidden" name="MAX_FILE_SIZE" value="1000000"> Image Name <input class=logoname name="imagename" type="text" id="logoname" /> <input name="file" type="file" id="file" /> <br> <input class=submit tabindex="2" accesskey="l" type="submit" name="cmdupload" value="Upload" /> </form> this is my problem .. you can see that the action is a javascript ... the script that i am calling is not accepting the post because it thinks that the SUBMIT button was not pushed and its kicking me back to the form ... if I use that JS as the action link will the post variables still go through to my script ? thanks Link to comment https://forums.phpfreaks.com/topic/132607-form-post-help/ Share on other sites More sharing options...
MatthewJ Posted November 13, 2008 Share Posted November 13, 2008 Have you tried putting the ajax function call in "onsubmit" instead of in the action? Link to comment https://forums.phpfreaks.com/topic/132607-form-post-help/#findComment-689557 Share on other sites More sharing options...
imarockstar Posted November 13, 2008 Author Share Posted November 13, 2008 Im not sure how to do that ... could you help ? Link to comment https://forums.phpfreaks.com/topic/132607-form-post-help/#findComment-689559 Share on other sites More sharing options...
MatthewJ Posted November 13, 2008 Share Posted November 13, 2008 <form name="upload-form" id="upload-form" method="post" action="" onsubmit="javascript:ajaxFunction('scripts/image_go.php')"enctype="multipart/form-data"> Not sure if that will work, but I would guess it is because your php script is checking for whether the submit button was pressed with isset... Give it a go Link to comment https://forums.phpfreaks.com/topic/132607-form-post-help/#findComment-689561 Share on other sites More sharing options...
imarockstar Posted November 13, 2008 Author Share Posted November 13, 2008 that worked ... however the _POST values are not going through . so thats sort of pointless lol .. Link to comment https://forums.phpfreaks.com/topic/132607-form-post-help/#findComment-689573 Share on other sites More sharing options...
imarockstar Posted November 13, 2008 Author Share Posted November 13, 2008 I need al the form fields to post to my script .. Link to comment https://forums.phpfreaks.com/topic/132607-form-post-help/#findComment-689624 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.