| | |
How to avoid aa empty values in a text box
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
Hi this is nathen can you please some one help me the following is my form what i want is when ever i fill an empty value that is nothis in my text box and when click on shareacoupon button i need a message that empty values are not allowed this is urgent.Thanks in advance ....
PHP Syntax (Toggle Plain Text)
<?php ob_start(); extract($_REQUEST); include("includes/connection.php"); if(isset($_POST["submit"])) { $sql_insert="INSERT INTO `fair`.`couponshare` (`storename` ,`code` ,`offer` ,`expiration Date`) VALUES ('$store_name', '$store_code', '$deal_discount', '$edate')"; $res=mysql_query($sql_insert); } ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> <link rel="stylesheet" type="text/css" href="images/style.css"> <link rel="stylesheet" type="text/css" href="chrometheme/chromestyle.css" /> <script type="text/javascript" language="javascript" src="includes/validation.js"></script> <script language="JavaScript" type="text/javascript" src="images/ddmenu.js"></script> <link rel="stylesheet" type="text/css" media="all" href="calendar-win2k-cold-1.css" title="win2k-cold-1" /> <script type="text/javascript" src="lang/calendar.js"></script> <script type="text/javascript" src="lang/calendar-en.js"></script> <script type="text/javascript" src="lang/calendar-setup.js"></script> <script type="text/javascript"> Calendar.setup({ inputField : "f_date_k", // id of the input field ifFormat : "%m/%d/%Y", // format of the input field button : "f_trigger_k", // trigger for the calendar (button ID) align : "Tl", // alignment (defaults to "Bl") singleClick : true }) Calendar.setup({ inputField : "f_date_g", // id of the input field ifFormat : "%m/%d/%Y", // format of the input field button : "f_trigger_g", // trigger for the calendar (button ID) align : "Tl", // alignment (defaults to "Bl") singleClick : true }) </script> </head> </head> <body> <form name="myform" method="post" action=""> <table width="200" border="1"> <tr> <td colspan="2" align="center"><strong><font size="+1" color="#6699FF">Share A Coupon</font></strong></td> </tr> <tr> <td>Store Name:</td><td><input type="text" name="store_name" id="store_name" /></td> </tr> <tr> <td>Code:</td><td><input type="text" name="store_code" id="store_code" /></td> </tr> <tr> <td>Offer:</td><td><input type="text" name="deal_discount" id="deal_discount" /></td> </tr> <tr> <td colspan="2"><span class="normal"> Expiration Date: <input type="text" name="edate" class="normal" style="width:80px;" id="f_date_g"> <img src="images/calendar.gif" id="f_trigger_g" style="cursor: pointer; " onmouseover="this.style.background='red';" onmouseout="this.style.background=''" border="0" /></span></td> </tr> <tr> <td><input type="submit" name="submit" id="submit" value="Submit coupon"/></td><td align="center"><input type="submit" name="close" id="close" value="close"/></td> </tr> </table> </form> </body> </html>
Last edited by Ezzaral; Apr 18th, 2009 at 11:39 am. Reason: Added [code] [/code] tags. Learn to use them.
•
•
Join Date: May 2008
Posts: 232
Reputation:
Solved Threads: 19
My Blog, Life and everything that matters to me - SamRudge.co.uk
2x Macbook Pro's, 1x Mac Pro, 1x iMac, 2x Macbook's running Fedora linux - In conclusion, I hate windows =)
2x Macbook Pro's, 1x Mac Pro, 1x iMac, 2x Macbook's running Fedora linux - In conclusion, I hate windows =)
![]() |
Similar Threads
- Please check my code below (Java)
- This Should be Easy for You Guys! (Linux Servers and Apache)
- not-a-virusadware (Viruses, Spyware and other Nasties)
Other Threads in the PHP Forum
- Previous Thread: form input to text file - cant figure this one out
- Next Thread: nested loop problem
| Thread Tools | Search this Thread |
apache api array beginner binary body broken buttons cakephp checkbox class cms code cron curl database date date/time display dynamic ebooks echo email error file files folder form forms function functions global google href htaccess html image include insert ip javascript joomla limit link list login mail mediawiki menu mlm msqli_multi_query multiple mycodeisbad mysql navigation number oop parameter paypal pdf php phpincludeissue problem query radio random recourse recursion regex remote script search seo server sessions sms source sp space speed sql static subdomain syntax system table tag tutorial update upload url validator variable vbulletin video web webdesign white xml youtube





