Jump to content

Required Field


Juniorflip

Recommended Posts

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=""/>
<?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>[/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
Link to comment
https://forums.phpfreaks.com/topic/24378-required-field/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.