Jump to content


Photo

Required Field


  • Please log in to reply
1 reply to this topic

#1 Juniorflip

Juniorflip
  • New Members
  • Pip
  • Newbie
  • 8 posts

Posted 18 October 2006 - 09:51 PM

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

<html>
<head>
<body>
<h4>EmailLauncher Note Form</h4>
<form action="write.php" method="post""> 
Campaign: <input name="campaign" type="text" value=""/> 
<?php
if(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>

However it automatically kill it right away.  Is there a way to have the function execute on button click before going to write.php

#2 sanfly

sanfly
  • Members
  • PipPipPip
  • Advanced Member
  • 344 posts
  • LocationNew Zealand

Posted 18 October 2006 - 10:27 PM

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
If you're not part of the solution, you're part of the precipitate




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users