cluce Posted April 20, 2007 Share Posted April 20, 2007 hey guys, I am doing a submit form in DW 8 using php. Can someone please tell me how can I make these textfields to be required? Right now they can submit null values. Here is the code I am using. <?php $to = "namet@reaganpower.com"; $subject = "Technical Support request form"; $body = " \n\n Name: $textfield \n\n E-Mail Address: $textfield2 \n\n Comments: $textarea"; mail ($to, $subject, $body); header("Location: http://reaganpower.com/thankyou.html"); ?> Quote Link to comment Share on other sites More sharing options...
jscix Posted April 20, 2007 Share Posted April 20, 2007 if ((!empty($textfield1)) && (!empty($textfield2))) { $to = "namet@reaganpower.com"; $subject = "Technical Support request form"; $body = " \n\n Name: $textfield \n\n E-Mail Address: $textfield2 \n\n Comments: $textarea"; mail ($to, $subject, $body); header("Location: http://reaganpower.com/thankyou.html"); } else { print "Fill out all feilds etc etc"; } Quote Link to comment Share on other sites More sharing options...
Fehnris Posted April 20, 2007 Share Posted April 20, 2007 If you want to check what they have entered before the form gets submitted you will have to use some form of client side script language ie. Javascript, VBscript to do the checking. I assume DW means Dreamweaver and I've not had any experience using it so I dont know what Client Side languages you can use with it. PHP is server side and so will not have the ability to check your form values before the form gets submitted. Quote Link to comment Share on other sites More sharing options...
cluce Posted May 2, 2007 Author Share Posted May 2, 2007 oh ok thanks for your input. Javascript does work with Dreamweaver. Quote Link to comment 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.