sub0dos Posted June 2, 2009 Share Posted June 2, 2009 Hello, I need help on making a field a necessary requirement. I know this is fairly simple but Ive looked around so many places and cannot find the solution. Here is my code <form action=”{$base_dir}order-detail.php” method=“post” class=“std” id=“sendOrderMessage”> {l s=‘Add a message:’} {l s=‘Please Type In Your Purchase Order Number….’} <textarea cols=“67” rows=“3” name=“msgText”></textarea> <input type=“hidden” name=“id_order” value=”{$order->id|intval}” > <input type=“submit” class=“button” name=“submitMessage” value=”{l s=‘Send’}”/> </form> Thank you in advance. Sub. Quote Link to comment https://forums.phpfreaks.com/topic/160643-field-requirment/ Share on other sites More sharing options...
BobcatM Posted June 2, 2009 Share Posted June 2, 2009 I know this is fairly simple but Ive looked around Could I ask where you have looked around at? http://www.google.com/search?hl=en&q=form+validation+php&aq=f&oq=&aqi= Quote Link to comment https://forums.phpfreaks.com/topic/160643-field-requirment/#findComment-847800 Share on other sites More sharing options...
sub0dos Posted June 2, 2009 Author Share Posted June 2, 2009 Let me be more specific. I barley know my way around PHP, and i just need help with this bit of code. I would be very great grateful if someone could make this field so that it is required so i can just paste it in. Thank you. Tom. Quote Link to comment https://forums.phpfreaks.com/topic/160643-field-requirment/#findComment-847822 Share on other sites More sharing options...
Garethp Posted June 2, 2009 Share Posted June 2, 2009 if(mysql_real_escape_string($_POST['Fieldname']) != "") { //field contains something other than blank } else { //field is blank } Quote Link to comment https://forums.phpfreaks.com/topic/160643-field-requirment/#findComment-847825 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.