Jump to content


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


Required Field

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

<h4>EmailLauncher Note Form</h4>
<form action="write.php" method="post"">
Campaign: <input name="campaign" type="text" value=""/>
if(trim($_POST['campaign']) == "") {
  die("no value was entered");
<select name="experience">
<option>So So</option>
<select name="note">

Customer Lead Name: <input name="name" type="text" value=""/>

<input type="submit" />

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

Share this post

Link to post
Share on other sites
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

Share this post

Link to post
Share on other sites


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.