Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
contact form with required field only when clicked from dropdown
Old 09-16-2009, 10:34 PM contact form with required field only when clicked from dropdown
MDwebdev85's Avatar
Extreme Talker

Posts: 209
Location: North Carolina
Trades: 0
I'm not sure if this has been reviewed before, but I didn't see anything in the forum about it. I have a basic php submit form that I have customized per my needs for fields. Everything works perfectly however, I have a drop down menu with some selections. One of the selections, when clicked will display an additional field **only displays when clicked**, I need that field to be required to be filled out only when it is displayed/clicked. Can someone point me in the right direction? My php skills are very light to none. Thanks, I can post my code as well if that makes it easier. Thanks..
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
MDwebdev85 is online now
Reply With Quote
View Public Profile Visit MDwebdev85's homepage!
 
 
Register now for full access!
Old 09-17-2009, 12:02 AM Re: contact form with required field only when clicked from dropdown
MDwebdev85's Avatar
Extreme Talker

Posts: 209
Location: North Carolina
Trades: 0
Here is the code:


<?
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
$fromemail=$_POST['Email'];
$email = $HTTP_POST_VARS[Email];
$mailto = "--------@yahoo.com";
$mailsubj = "Contact Form";
$mailhead = "From: $fromemail";
reset ($HTTP_POST_VARS);
$mailbody = "Values submitted from web site form: General Contact Form - www.-------.pro/gen.php/ \n";
while (list ($key, $val) = each ($HTTP_POST_VARS)) { $mailbody .= "$key : $val\n\n"; }
if (!eregi("\n",$HTTP_POST_VARS[Email])) { mail($mailto, $mailsubj, $mailbody, $mailhead); }
echo "<span style='color:#666666'>Your message has been sent &amp; someone will contact you shortly. Thanks for choosing -----.</span>";
}
?>
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
MDwebdev85 is online now
Reply With Quote
View Public Profile Visit MDwebdev85's homepage!
 
Reply     « Reply to contact form with required field only when clicked from dropdown
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.27353 seconds with 12 queries