laide234 Posted September 14, 2006 Share Posted September 14, 2006 Here is the code...[code] <form action="processApp.php?action=apply" method="post" enctype="multipart/form-data" name="apply" id="apply"> <tr> <td><div align="right"><strong>*Applicant's Name: </strong></div></td> <td><input name="name" id="name" type="text" size="40" maxlength="30"></td> </tr> <tr> <td><div align="right"><strong>*Applicant's Email Address: </strong></div></td> <td><input name="email" id="email" type="text" size="40" maxlength="30"></td> </tr> <tr> <td colspan="2"><hr width="350"></td> </tr> <tr> <td><div align="right"><strong>Work Phone: </strong></div></td> <td><input name="wPhone" id="wPhone" type="text" size="40" maxlength="20"></td> </tr> <tr> <td><div align="right"><strong>Home Phone: </strong></div></td> <td><input name="hPhone" id="hPhone" type="text" size="40" maxlength="20"></td> </tr> <tr> <td><div align="right"><strong>Cell Phone: </strong></div></td> <td><input name="cPhone" id="cPhone" type="text" size="40" maxlength="20"></td> </tr> <tr> <td colspan="2"><hr width="350"></td> </tr> <tr> <td><div align="right"><strong>Paste your resume and/or cover letter here</strong></div></td> <td rowspan="2"><textarea name="resume" id="resume" cols="36" rows="10"></textarea></td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> <td><input name="submitApp" id="submitApp" type="image" onClick="validateApply();" src="..//images/submit_app_button.gif" width="120" height="20" border="1"></td> </tr> </form>[/code]When I click on the image, it submits. I was going to add some form validation (and a submit(); )to "validateApply();" , but data is being sent with or without the submit. I even put a simple alert() in validateApply(), just to test it. But I get the alert, and then data is sent. I want to be able to control this with validation and a submit().I do not want to access processApp.php until I am sure there is data in the fields.What am I missing??? Link to comment https://forums.phpfreaks.com/topic/20702-solved-what-is-wrong-with-this-form/ Share on other sites More sharing options...
manmadareddy Posted September 14, 2006 Share Posted September 14, 2006 onClick="return validateApply();"try this Link to comment https://forums.phpfreaks.com/topic/20702-solved-what-is-wrong-with-this-form/#findComment-91614 Share on other sites More sharing options...
laide234 Posted September 14, 2006 Author Share Posted September 14, 2006 Genius. That did the trick. Thanks a bunch. ;D Link to comment https://forums.phpfreaks.com/topic/20702-solved-what-is-wrong-with-this-form/#findComment-91622 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.