Juniorflip Posted October 18, 2006 Share Posted October 18, 2006 If I am going to do required field in php when do I make the function happen. On the next php or the current one. Here is my code[code]<html><head><body><h4>EmailLauncher Note Form</h4><form action="write.php" method="post""> Campaign: <input name="campaign" type="text" value=""/> <?phpif(trim($_POST['campaign']) == "") { die("no value was entered");} ?><select name="experience"> <option>Good</option><option>So So</option><option>Bad</option><option>Cancelled</option></select><br><br><select name="note"> <option>Yes</option><option>No</option><option>Supersave</option></select><br><Br>Customer Lead Name: <input name="name" type="text" value=""/> <input type="submit" /></form></body></html>[/code]However it automatically kill it right away. Is there a way to have the function execute on button click before going to write.php Quote Link to comment Share on other sites More sharing options...
sanfly Posted October 18, 2006 Share Posted October 18, 2006 To use php, the check has to be on the next page.If you want to check on the same page (ie: when the submit button is pressed, but before the information is submitted to the next page) use javascript Quote Link to comment 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.