Urgent help needed - checkbox output problem / php form

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
bachans
New php-forum User
New php-forum User
Posts: 67
Joined: Thu May 19, 2011 6:01 am
Location: India

Sun May 22, 2011 11:55 pm

HI,

I have just modified your code. In this code, I am just showing the activities that one selected with comma separator.

Please check the following code

Code: Select all

<?php 
if($_POST) {

if($_POST[activities_1] !='') {
	$email_body .= $_POST[activities_1].",";
}
if($_POST[activities_2] !='') {
	$email_body .= $_POST[activities_2].",";
}
if($_POST[activities_3] !='') {
	$email_body .= $_POST[activities_3].",";
}
	
	$email_body = substr($email_body,0,-1);
	echo $email_body;
}

?>

<html>
	<body>
		<form action='' method ='post'>
			<input name="activities_1" type="checkbox" value="Water Sports " />	Water Sports &nbsp;&nbsp;
			<input name="activities_2" type="checkbox" value="Scuba Diving" />Scuba Diving &nbsp;&nbsp;
			<input name="activities_3" type="checkbox" value="Swimming" />Swimming &nbsp;&nbsp;
			<br />
			<input type='submit' />
		</form>
	</body>
</html>
Thanks
Bachan Smruty

bachans
New php-forum User
New php-forum User
Posts: 67
Joined: Thu May 19, 2011 6:01 am
Location: India

Mon May 23, 2011 2:36 am

I am sorry, bymistakely I have forgotten to give quotes in the $_POST variables.

Code: Select all

<?php
$myemail = 'email@email.com';
$to = $myemail;
$email_subject = "New Enquiry";

if($_POST) {

if($_POST['activities_1'] !='') {
   $email_body .= $_POST['activities_1'].",";
}
if($_POST['activities_2'] !='') {
   $email_body .= $_POST['activities_2'].",";
}
if($_POST['activities_3'] !='') {
   $email_body .= $_POST['activities_3'].",";
}
   
   $email_body = substr($email_body,0,-1);
   echo $email_body;
}

mail($to,$email_subject,$email_body,$headers);

?> 
Please try this..

bachans
New php-forum User
New php-forum User
Posts: 67
Joined: Thu May 19, 2011 6:01 am
Location: India

Mon May 23, 2011 3:43 am

Shinteyz wrote:Tried that too. Still get a blank email.

This is the form in question, if that helps.
http://sunnivamaldives.com/site2/suggest.html

Please help me out. Both of your codes did not work. I get a blank email even though I did select checkboxes.

I have made a dummy application for it..

Please find the following code

Code: Select all

<?php
if($_POST) {
	// Contact subject
	$subject =$_POST['subject'];
	// Details
	if($_POST['activities_1'] !='') {
	$email_body .= $_POST['activities_1'].",";
	}
	if($_POST['activities_2'] !='') {
		$email_body .= $_POST['activities_2'].",";
	}
	if($_POST['activities_3'] !='') {
		$email_body .= $_POST['activities_3'].",";
	}
	if($_POST['activities_4'] !='') {
		$email_body .= $_POST['activities_4'].",";
	}
	if($_POST['activities_5'] !='') {
		$email_body .= $_POST['activities_5'].",";
	}
	if($_POST['activities_6'] !='') {
		$email_body .= $_POST['activities_6'].",";
	}
	if($_POST['activities_7'] !='') {
		$email_body .= $_POST['activities_7'].",";
	}
	if($_POST['activities_8'] !='') {
		$email_body .= $_POST['activities_8'].",";
	}
	if($_POST['activities_9'] !='') {
		$email_body .= $_POST['activities_9'].",";
	}
	$email_body = substr($email_body,0,-1);

	// Mail of sender
	$mail_from=$_POST['customer_mail'];
	// From
	$name = $_POST['customer_name'];
	$header="from: $name <$mail_from>";

	// Enter your email address
	$to ='bachans@mindfiresolutions.com'; // Here you can give the reciever mail address

	$send_contact=mail($to,$subject,$email_body,$header);

	// Check, if message sent to your email
	// display message "We've recived your information"
	if($send_contact){
	$out_put = "We've recived your contact information";
	}
	else {
	$out_put = "ERROR on sending mail";
	}
}
?>

<html>
	<body>
		<span><?php if(isset($_POST)){echo $out_put;}?></span><br /><br />
		<form method="post" action="">
			Subject : <input type="text" size="30" name="subject" /><br /><br />
			    What activities do you enjoy?

    
	<table width="356">
      <tr>
        <td width="111"><span class="style9">
          <input name="activities_1" type="checkbox" id="activities_1" value="Water Sports " />
Water Sports </span></td>
        <td width="104"><span class="style9">
          <input name="activities_2" type="checkbox" id="activities_2" value="Scuba Diving" /> 
          Scuba Diving</span></td>
        <td width="125"><span class="style9">

          <input name="activities_3" type="checkbox" id="activities_3" value="Swimming" />
Swimming</span></td>
      </tr>
      <tr>
        <td height="23"><span class="style9">
          <input name="activities_4" type="checkbox" id="activities_4" value="Snorkelling" /> 
          Snorkelling</span></td>
        <td><span class="style9">
          <input name="activities_5" type="checkbox" value="Fishing" /> 
          Fishing</span></td>

        <td><span class="style9">
          <input name="activities_6" type="checkbox" value="Sightseeing" /> 
          Sightseeing</span></td>
      </tr>
      <tr>
        <td height="23"><span class="style9">
          <input name="activities_7" type="checkbox" value="Surfing" />
          Surfing</span></td>

        <td><span class="style9">
          <input name="activities_8" type="checkbox" value="Cruising" />
          Cruising</span></td>
        <td><span class="style9">
          <input name="activities_9" type="checkbox" value="Sailing" />
          Sailing</span></td>
      </tr>
      
    </table>
	
			mail from : <input type="text" size="30" name="customer_mail"><br /><br />
			Customer Name : <input type="text" name="customer_name" /><br /><br />
			<input type="submit" />
		</form>
	</body>
</html>

bachans
New php-forum User
New php-forum User
Posts: 67
Joined: Thu May 19, 2011 6:01 am
Location: India

Mon May 23, 2011 5:01 am

Shinteyz wrote:Hey the checkboxes part works perfectly now, thanks so much.
http://sunnivamaldives.com/site2/suggest.php

Although, how do I email me other fields as well? where do I include other fields in the php script?
Please check the following code.

Code: Select all

<?php
if($_POST) {
	// Contact subject
	$subject ='Add subject over here';
	// Details
	$email_body.= '<html><body>About Customer <br /><br />';
	$email_body.= 'Customer name : '.$_POST['name'].'<br />';
	$email_body.= 'Customer email : '.$_POST['email'].'<br />';
	$email_body.= 'Country : '.$_POST['country'].'<br />';
	$email_body.= 'Budget : '.htmlspecialchars(stripslashes($_POST['budget'])).'<br /><br />';
	$email_body.= 'Arrival & Accomodation<br /><br />';
	$email_body.= 'Arrive TIme : '.$_POST['select2'].'<br />';
	$email_body.= 'No. of Nights : '.$_POST['select3'].'<br />';
	$email_body.= 'No. of people : '.$_POST['select4'].'<br />';
	$email_body.= 'Children : '.$_POST['select'].'<br />';
	$email_body.= 'Accomodation class : '.$_POST['select5'].'<br />';
	
	$email_body.= 'Activities : ';
	if($_POST['activities_1'] !='') {
	$email_body .= $_POST['activities_1'].",";
	}
	if($_POST['activities_2'] !='') {
		$email_body .= $_POST['activities_2'].",";
	}
	if($_POST['activities_3'] !='') {
		$email_body .= $_POST['activities_3'].",";
	}
	if($_POST['activities_4'] !='') {
		$email_body .= $_POST['activities_4'].",";
	}
	if($_POST['activities_5'] !='') {
		$email_body .= $_POST['activities_5'].",";
	}
	if($_POST['activities_6'] !='') {
		$email_body .= $_POST['activities_6'].",";
	}
	if($_POST['activities_7'] !='') {
		$email_body .= $_POST['activities_7'].",";
	}
	if($_POST['activities_8'] !='') {
		$email_body .= $_POST['activities_8'].",";
	}
	if($_POST['activities_9'] !='') {
		$email_body .= $_POST['activities_9'].",";
	}
	$email_body = substr($email_body,0,-1);
	$email_body .='<br />' ;
	
	$email_body.= 'What makes a perfect holiday?';
	if($_POST['checkbox1'] !='') {
	$email_body .= $_POST['checkbox1'].",";
	}
	if($_POST['checkbox2'] !='') {
	$email_body .= $_POST['checkbox2'].",";
	}
	if($_POST['checkbox3'] !='') {
	$email_body .= $_POST['checkbox3'].",";
	}
	if($_POST['checkbox4'] !='') {
	$email_body .= $_POST['checkbox4'].",";
	}
	if($_POST['checkbox5'] !='') {
	$email_body .= $_POST['checkbox5'].",";
	}
	if($_POST['checkbox6'] !='') {
	$email_body .= $_POST['checkbox6'].",";
	}
	$email_body = substr($email_body,0,-1);
	$email_body .='<br />' ;
	
	$email_body.= 'Facilities you would like?';
	if($_POST['checkbox_1'] !='') {
	$email_body .= $_POST['checkbox_1'].",";
	}
	if($_POST['checkbox_2'] !='') {
	$email_body .= $_POST['checkbox_2'].",";
	}
	if($_POST['checkbox_3'] !='') {
	$email_body .= $_POST['checkbox_3'].",";
	}
	if($_POST['checkbox_4'] !='') {
	$email_body .= $_POST['checkbox_4'].",";
	}
	if($_POST['checkbox_5'] !='') {
	$email_body .= $_POST['checkbox_5'].",";
	}
	if($_POST['checkbox_6'] !='') {
	$email_body .= $_POST['checkbox_6'].",";
	}
	if($_POST['checkbox_7'] !='') {
	$email_body .= $_POST['checkbox_7'].",";
	}
	if($_POST['checkbox_8'] !='') {
	$email_body .= $_POST['checkbox_8'].",";
	}
	$email_body = substr($email_body,0,-1);
	$email_body .='<br /> message : <br />'.$_POST['textfield3'].'</body></html>' ;
	
	
	// Mail of sender
	$mail_from=$_POST['email'];
	// From
	$name = $_POST['name'];
	
	// Always set content-type when sending HTML email
	$header = "MIME-Version: 1.0" . "\r\n";
	$header .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";
	$header.="from: $name <$mail_from>";

	// Enter your email address
	$to ='bachans@mindfiresolutions.com'; // Here the mail address of reciever

	$send_contact=mail($to,$subject,$email_body,$header);

	// Check, if message sent to your email
	// display message "We've recived your information"
	if($send_contact){
	$out_put = "We've recived your contact information";
	}
	else {
	$out_put = "ERROR on sending mail";
	}
}
?>

<html>
<style type="text/css">
<!--
.style1 {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	padding:3px;
}

.inputz{background:white; border-bottom:1px dashed #0788EE; border-right:none; border-left:none; border-top:1px dashed #0788EE; color:#0788EE; font-size:12px; font-family:Geneva, Arial, Helvetica, sans-serif; font-weight:bold; height:23px; padding-left:6px;}
.inputz2{background:white; border-bottom:1px dashed #0788EE; border-right:none; border-left:none; border-top:1px dashed #0788EE; color:#0788EE; font-size:12px; font-family:Geneva, Arial, Helvetica, sans-serif; font-weight:bold; padding-left:6px;}
.style3 {
	color: #FFFFFF;
	font-weight: bold;
}
.style5 {font-size: 11px}
.style6 {background: white; border-bottom: 1px dashed #0788EE; border-right: none; border-left: none; border-top: 1px dashed #0788EE; color: #0788EE; font-size: 11px; font-family: Geneva, Arial, Helvetica, sans-serif; font-weight: bold; height: 23px; padding-left: 6px; }
.style7 {
	border-bottom: 1px dashed #0788EE;
	border-right: none;
	border-left: none;
	border-top: 1px dashed #0788EE;
	color: #0788EE;
	font-family: Geneva, Arial, Helvetica, sans-serif;
	font-weight: bold;
	height: 23px;
	padding-left: 6px;
	background: white;
	font-size: 11px;
}
.style10 {color: #033D6B; font-size: 11px; }
-->
</style>
<body>
          <span></span><br /><br />
          <form method="post" action="">
            <table width="541" cellpadding="4" cellspacing="0" class="style1">
              <tr>
                <td width="167" height="31" bgcolor="#0086B3" style="letter-spacing:1px;"><span class="style3">Tell us a bit about you </span></td>
                <td width="356" bgcolor="#0086B3" style="letter-spacing:1px;">&nbsp;</td>

              </tr>
              <tr>
                <td height="22" bgcolor="#D0E7F6"><span class="style5">Your name.</span></td>
                <td bgcolor="#D0E7F6"><input name="name" type="text" class="style7" id="name" /></td>
              </tr>
              <tr>
                <td bgcolor="#B4D9F1"><span class="style5">Your email address.</span></td>
                <td bgcolor="#B4D9F1"><input name="email" type="text" class="style7" id="email" /></td>

              </tr>
              <tr>
                <td bgcolor="#D0E7F6"><span class="style5">Where are you from?
                  <!-- start of drop down country selection list -->
                      <!-- generated via http://javascript.about.com/ Script Generator -->
                      <!-- end of drop down country selection list -->
                </span></td>
                <td bgcolor="#D0E7F6"><select name="country" class="style6" id="country">
                    <option value="0" selected="selected">Please Select</option>

                    <option value="AF">Afghanistan</option>
                    <option value="AL">Albania</option>
                    <option value="DZ">Algeria</option>
                    <option value="AS">American Samoa</option>
                    <option value="AD">Andorra</option>
                    <option value="AO">Angola</option>

                    <option value="AI">Anguilla</option>
                    <option value="AQ">Antarctica</option>
                    <option value="AG">Antigua and Barbuda</option>
                    <option value="AR">Argentina</option>
                    <option value="AM">Armenia</option>
                    <option value="AW">Aruba</option>

                    <option value="AU">Australia</option>
                    <option value="AT">Austria</option>
                    <option value="AZ">Azerbaijan</option>
                    <option value="BS">Bahamas</option>
                    <option value="BH">Bahrain</option>
                    <option value="BD">Bangladesh</option>

                    <option value="BB">Barbados</option>
                    <option value="BY">Belarus</option>
                    <option value="BE">Belgium</option>
                    <option value="BZ">Belize</option>
                    <option value="BJ">Benin</option>
                    <option value="BM">Bermuda</option>

                    <option value="BT">Bhutan</option>
                    <option value="BO">Bolivia</option>
                    <option value="BA">Bosnia and Herzegovina</option>
                    <option value="BW">Botswana</option>
                    <option value="BV">Bouvet Island</option>
                    <option value="BR">Brazil</option>

                    <option value="IO">British Indian Ocean Territory</option>
                    <option value="BN">Brunei Darussalam</option>
                    <option value="BG">Bulgaria</option>
                    <option value="BF">Burkina Faso</option>
                    <option value="BI">Burundi</option>
                    <option value="KH">Cambodia</option>

                    <option value="CM">Cameroon</option>
                    <option value="CA">Canada</option>
                    <option value="CV">Cape Verde</option>
                    <option value="KY">Cayman Islands</option>
                    <option value="CF">Central African Republic</option>
                    <option value="TD">Chad</option>

                    <option value="CL">Chile</option>
                    <option value="CN">China</option>
                    <option value="CX">Christmas Island</option>
                    <option value="CC">Cocos (Keeling) Islands</option>
                    <option value="CO">Colombia</option>
                    <option value="KM">Comoros</option>

                    <option value="CG">Congo</option>
                    <option value="CD">Congo, the Democratic Republic of</option>
                    <option value="CK">Cook Islands</option>
                    <option value="CR">Costa Rica</option>
                    <option value="CI">Cote D'Ivoire (Ivory Coast)</option>
                    <option value="HR">Croatia (Hrvatska)</option>

                    <option value="CU">Cuba</option>
                    <option value="CY">Cyprus</option>
                    <option value="CZ">Czech Republic</option>
                    <option value="DK">Denmark</option>
                    <option value="DJ">Djibouti</option>
                    <option value="DM">Dominica</option>

                    <option value="DO">Dominican Republic</option>
                    <option value="TP">East Timor</option>
                    <option value="EC">Ecuador</option>
                    <option value="EG">Egypt</option>
                    <option value="SV">El Salvador</option>
                    <option value="GQ">Equatorial Guinea</option>

                    <option value="ER">Eritrea</option>
                    <option value="EE">Estonia</option>
                    <option value="ET">Ethiopia</option>
                    <option value="FK">Falkland Islands (Malvinas)</option>
                    <option value="FO">Faroe Islands</option>
                    <option value="FJ">Fiji</option>

                    <option value="FI">Finland</option>
                    <option value="FR">France</option>
                    <option value="GF">French Guiana</option>
                    <option value="PF">French Polynesia</option>
                    <option value="TF">French Southern Territories</option>
                    <option value="GA">Gabon</option>

                    <option value="GM">Gambia</option>
                    <option value="GE">Georgia</option>
                    <option value="DE">Germany</option>
                    <option value="GH">Ghana</option>
                    <option value="GI">Gibraltar</option>
                    <option value="GR">Greece</option>

                    <option value="GL">Greenland</option>
                    <option value="GD">Grenada</option>
                    <option value="GP">Guadeloupe</option>
                    <option value="GU">Guam</option>
                    <option value="GT">Guatemala</option>
                    <option value="GN">Guinea</option>

                    <option value="GW">Guinea-Bissau</option>
                    <option value="GY">Guyana</option>
                    <option value="HT">Haiti</option>
                    <option value="HM">Heard and McDonald Islands</option>
                    <option value="HN">Honduras</option>
                    <option value="HK">Hong Kong</option>

                    <option value="HU">Hungary</option>
                    <option value="IS">Iceland</option>
                    <option value="IN">India</option>
                    <option value="ID">Indonesia</option>
                    <option value="IR">Iran</option>
                    <option value="IQ">Iraq</option>

                    <option value="IE">Ireland</option>
                    <option value="IL">Israel</option>
                    <option value="IT">Italy</option>
                    <option value="JM">Jamaica</option>
                    <option value="JP">Japan</option>
                    <option value="JO">Jordan</option>

                    <option value="KZ">Kazakhstan</option>
                    <option value="KE">Kenya</option>
                    <option value="KI">Kiribati</option>
                    <option value="KP">Korea (North)</option>
                    <option value="KR">Korea (South)</option>
                    <option value="KW">Kuwait</option>

                    <option value="KG">Kyrgyzstan</option>
                    <option value="LA">Laos</option>
                    <option value="LV">Latvia</option>
                    <option value="LB">Lebanon</option>
                    <option value="LS">Lesotho</option>
                    <option value="LR">Liberia</option>

                    <option value="LY">Libya</option>
                    <option value="LI">Liechtenstein</option>
                    <option value="LT">Lithuania</option>
                    <option value="LU">Luxembourg</option>
                    <option value="MO">Macau</option>
                    <option value="MK">Macedonia</option>

                    <option value="MG">Madagascar</option>
                    <option value="MW">Malawi</option>
                    <option value="MY">Malaysia</option>
                    <option value="MV">Maldives</option>
                    <option value="ML">Mali</option>
                    <option value="MT">Malta</option>

                    <option value="MH">Marshall Islands</option>
                    <option value="MQ">Martinique</option>
                    <option value="MR">Mauritania</option>
                    <option value="MU">Mauritius</option>
                    <option value="YT">Mayotte</option>
                    <option value="MX">Mexico</option>

                    <option value="FM">Micronesia</option>
                    <option value="MD">Moldova</option>
                    <option value="MC">Monaco</option>
                    <option value="MN">Mongolia</option>
                    <option value="MS">Montserrat</option>
                    <option value="MA">Morocco</option>

                    <option value="MZ">Mozambique</option>
                    <option value="MM">Myanmar</option>
                    <option value="NA">Namibia</option>
                    <option value="NR">Nauru</option>
                    <option value="NP">Nepal</option>
                    <option value="NL">Netherlands</option>

                    <option value="AN">Netherlands Antilles</option>
                    <option value="NC">New Caledonia</option>
                    <option value="NZ">New Zealand (Aotearoa)</option>
                    <option value="NI">Nicaragua</option>
                    <option value="NE">Niger</option>
                    <option value="NG">Nigeria</option>

                    <option value="NU">Niue</option>
                    <option value="NF">Norfolk Island</option>
                    <option value="MP">Northern Mariana Islands</option>
                    <option value="NO">Norway</option>
                    <option value="OM">Oman</option>
                    <option value="PK">Pakistan</option>

                    <option value="PW">Palau</option>
                    <option value="PA">Panama</option>
                    <option value="PG">Papua New Guinea</option>
                    <option value="PY">Paraguay</option>
                    <option value="PE">Peru</option>
                    <option value="PH">Philippines</option>

                    <option value="PN">Pitcairn</option>
                    <option value="PL">Poland</option>
                    <option value="PT">Portugal</option>
                    <option value="PR">Puerto Rico</option>
                    <option value="QA">Qatar</option>
                    <option value="RE">Reunion</option>

                    <option value="RO">Romania</option>
                    <option value="RU">Russian Federation</option>
                    <option value="RW">Rwanda</option>
                    <option value="GS">S. Georgia and S. Sandwich Isls.</option>
                    <option value="KN">Saint Kitts and Nevis</option>
                    <option value="LC">Saint Lucia</option>

                    <option value="VC">Saint Vincent and the Grenadines</option>
                    <option value="WS">Samoa</option>
                    <option value="SM">San Marino</option>
                    <option value="ST">Sao Tome and Principe</option>
                    <option value="SA">Saudi Arabia</option>
                    <option value="SN">Senegal</option>

                    <option value="SC">Seychelles</option>
                    <option value="SL">Sierra Leone</option>
                    <option value="SG">Singapore</option>
                    <option value="SK">Slovakia</option>
                    <option value="SI">Slovenia</option>
                    <option value="SB">Solomon Islands</option>

                    <option value="SO">Somalia</option>
                    <option value="ZA">South Africa</option>
                    <option value="ES">Spain</option>
                    <option value="LK">Sri Lanka</option>
                    <option value="SH">St. Helena</option>
                    <option value="PM">St. Pierre and Miquelon</option>

                    <option value="SD">Sudan</option>
                    <option value="SR">Suriname</option>
                    <option value="SJ">Svalbard and Jan Mayen Islands</option>
                    <option value="SZ">Swaziland</option>
                    <option value="SE">Sweden</option>
                    <option value="CH">Switzerland</option>

                    <option value="SY">Syria</option>
                    <option value="TW">Taiwan</option>
                    <option value="TJ">Tajikistan</option>
                    <option value="TZ">Tanzania</option>
                    <option value="TH">Thailand</option>
                    <option value="TG">Togo</option>

                    <option value="TK">Tokelau</option>
                    <option value="TO">Tonga</option>
                    <option value="TT">Trinidad and Tobago</option>
                    <option value="TN">Tunisia</option>
                    <option value="TR">Turkey</option>
                    <option value="TM">Turkmenistan</option>

                    <option value="TC">Turks and Caicos Islands</option>
                    <option value="TV">Tuvalu</option>
                    <option value="UM">US Minor Outlying Islands</option>
                    <option value="UG">Uganda</option>
                    <option value="UA">Ukraine</option>
                    <option value="AE">United Arab Emirates</option>

                    <option value="GB">United Kingdom (GB)</option>
                    <option value="US">United States</option>
                    <option value="UY">Uruguay</option>
                    <option value="UZ">Uzbekistan</option>
                    <option value="VU">Vanuatu</option>
                    <option value="VA">Vatican City State (Holy See)</option>

                    <option value="VE">Venezuela</option>
                    <option value="VN">Viet Nam</option>
                    <option value="VG">Virgin Islands (British)</option>
                    <option value="VI">Virgin Islands (U.S.)</option>
                    <option value="WF">Wallis and Futuna Islands</option>
                    <option value="EH">Western Sahara</option>

                    <option value="YE">Yemen</option>
                    <option value="YU">Yugoslavia</option>
                    <option value="ZM">Zambia</option>
                    <option value="ZW">Zimbabwe</option>
                    <option value="Other">Other</option>
                </select></td>

              </tr>
              <tr>
                <td bgcolor="#B4D9F1"><span class="style5">What is your budget?</span></td>
                <td bgcolor="#B4D9F1"><select name="budget" class="style6" id="budget">
                    <option value="Less than $700">Less than $700</option>
                    <option value="Less than $1000" selected="selected">Less than $1000</option>
                    <option value="$1000 to $2000">$1000 to $2000</option>

                    <option value="$2000 to $4000">$2000 to $4000</option>
                    <option value="$4000 to $8000">$4000 to $8000</option>
                    <option value="Over $8000">Over $8000</option>
                    <option value="Doesn't matter">Doesn't matter</option>
                  </select>
                </td>
              </tr>

              <tr>
                <td height="31" bgcolor="#0086B3" style="letter-spacing:1px;"><span class="style3">Arrival & Acommodation </span></td>
                <td bgcolor="#0086B3" style="letter-spacing:1px;">&nbsp;</td>
              </tr>
              <tr>
                <td height="22" bgcolor="#D0E7F6"><span class="style5">When do you plan to arrive? </span></td>
                <td bgcolor="#D0E7F6"><select name="select2" class="style6">

                    <option value="May 2011">May 2011</option>
                    <option value="June 2011">June 2011</option>
                    <option value="July 2011">July 2011</option>
                    <option value="August 2011">August 2011</option>
                    <option value="September 2011">September 2011</option>
                    <option value="October 2011">October 2011</option>

                    <option value="November 2011">November 2011</option>
                    <option value="December 2011">December 2011</option>
                    <option value="January 2012">January 2012</option>
                    <option value="February 2012">February 2012</option>
                    <option value="March 2012">March 2012</option>
                    <option value="April 2012">April 2012</option>

                    <option value="May 2012">May 2012</option>
                </select></td>
              </tr>
              <tr>
                <td bgcolor="#B4D9F1"><span class="style5">No. of nights </span></td>
                <td bgcolor="#B4D9F1"><select name="select3" class="style6">
                    <option value="1 -3 nights" selected="selected">1 -3 nights</option>

                    <option value="3 - 6 nights">3 - 6 nights</option>
                    <option value="1 - 2 weeks">1 - 2 weeks</option>
                    <option value="2 -3 weeks">2 -3 weeks</option>
                    <option value="3 - 4 weeks">3 - 4 weeks</option>
                    <option value="more than 4 weeks">more than 4 weeks</option>
                </select></td>

              </tr>
              <tr>
                <td bgcolor="#D0E7F6"><span class="style5">No. of people
                  <!-- start of drop down country selection list -->
                      <!-- generated via http://javascript.about.com/ Script Generator -->
                      <!-- end of drop down country selection list -->
                </span></td>
                <td bgcolor="#D0E7F6"><select name="select4" class="style6">
                    <option value="1 - 2 people" selected="selected">1 - 2 people</option>

                    <option value="2 - 4 people">2 - 4 people</option>
                    <option value="4 - 6 people">4 - 6 people</option>
                    <option value="more than 6 people">more than 6 people</option>
                </select></td>
              </tr>
              <tr>
                <td bgcolor="#B4D9F1"><span class="style5">Any children? </span></td>

                <td bgcolor="#B4D9F1"><select name="select" class="style6">
                    <option value="Yes">Yes</option>
                    <option value="No" selected="selected">No</option>
                  </select>
                </td>
              </tr>
              <tr>
                <td bgcolor="#B4D9F1"><span class="style5">Accommodation class </span></td>

                <td bgcolor="#D0E7F6"><select name="select5" class="style6">
                    <option value="1 star">1 star</option>
                    <option value="2 star - standard">2 star - standard</option>
                    <option value="3 star - moderate" selected="selected">3 star - moderate</option>
                    <option value="4 star - superior">4 star - superior</option>
                    <option value="5 star - luxury/deluxe">5 star - luxury/deluxe</option>

                  </select>
                </td>
              </tr>
              <tr>
                <td height="31" bgcolor="#0086B3" style="letter-spacing:1px;"><span class="style3">Holiday Details </span></td>
                <td bgcolor="#0086B3" style="letter-spacing:1px;">&nbsp;</td>
              </tr>
              <tr>

                <td height="22" bgcolor="#D0E7F6"><span class="style5">What activities do you enjoy? </span></td>
                <td bgcolor="#D0E7F6" class="style5"><table width="356">
                    <tr>
                      <td width="111"><span class="style10">
                        <input name="activities_1" type="checkbox" id="activities_1" value="Water Sports " />
                        Water Sports </span></td>
                      <td width="104"><span class="style10">
                        <input name="activities_2" type="checkbox" id="activities_2" value="Scuba Diving" />

                        Scuba Diving</span></td>
                      <td width="125"><span class="style10">
                        <input name="activities_3" type="checkbox" id="activities_3" value="Swimming" />
                        Swimming</span></td>
                    </tr>
                    <tr>
                      <td height="23"><span class="style10">
                        <input name="activities_4" type="checkbox" id="activities_4" value="Snorkelling" />

                        Snorkelling</span></td>
                      <td><span class="style10">
                        <input name="activities_5" type="checkbox" value="Fishing" />
                        Fishing</span></td>
                      <td><span class="style10">
                        <input name="activities_6" type="checkbox" value="Sightseeing" />
                        Sightseeing</span></td>

                    </tr>
                    <tr>
                      <td height="23"><span class="style10">
                        <input name="activities_7" type="checkbox" value="Surfing" />
                        Surfing</span></td>
                      <td><span class="style10">
                        <input name="activities_8" type="checkbox" value="Cruising" />
                        Cruising</span></td>

                      <td><span class="style10">
                        <input name="activities_9" type="checkbox" value="Sailing" />
                        Sailing</span></td>
                    </tr>
                </table></td>
              </tr>
              <tr>
                <td height="22" bgcolor="#B4D9F1"><span class="style5">What makes a perfect holiday? </span></td>

                <td bgcolor="#B4D9F1" class="style5"><table width="356">
                    <tr>
                      <td width="111"><span class="style10">
                        <input name="checkbox1" type="checkbox" value="Adventures" />
                        Adventures </span></td>
                      <td width="104"><span class="style10">
                        <input name="checkbox2" type="checkbox" value="Beaches" />
                        Beaches</span></td>

                      <td width="125"><span class="style10">
                        <input name="checkbox3" type="checkbox" value="Privacy" />
                        Privacy</span></td>
                    </tr>
                    <tr>
                      <td><span class="style10">
                        <input name="checkbox4" type="checkbox" value="Exploring" />
                        Exploring</span></td>

                      <td><span class="style10">
                        <input name="checkbox5" type="checkbox" value="Culture" />
                        Culture </span></td>
                      <td><span class="style10">
                        <input name="checkbox6" type="checkbox" value="Romance" />
                        Romance </span></td>
                    </tr>
                </table></td>

              </tr>
              <tr>
                <td height="22" bgcolor="#D0E7F6"><span class="style5">Facilities you would like? </span></td>
                <td bgcolor="#D0E7F6" class="style5"><table width="356">
                    <tr>
                      <td width="111"><span class="style10">
                        <input name="checkbox_1" type="checkbox" value="Spa" />
                        Spa</span></td>

                      <td width="104"><span class="style10">
                        <input name="checkbox_2" type="checkbox" value="Gym" />
                        Gym</span></td>
                      <td width="125"><span class="style10">
                        <input name="checkbox_3" type="checkbox" value="checkbox" />
                        Discos</span></td>
                    </tr>
                    <tr>

                      <td height="23"><span class="style10">
                        <input name="checkbox_4" type="checkbox" value="Dive Club " />
                        Dive Club </span></td>
                      <td><span class="style10">
                        <input name="checkbox_5" type="checkbox" value="Kids Club" />
                        Kids Club </span></td>
                      <td><span class="style10">
                        <input name="checkbox_6" type="checkbox" value="Open-Air Shower" />

                        Open-Air Shower </span></td>
                    </tr>
                    <tr>
                      <td height="23"><span class="style10">
                        <input name="checkbox_7" type="checkbox" value="Library" />
                        Library</span></td>
                      <td><span class="style10">
                        <input name="checkbox_8" type="checkbox" value="Shops" />

                        Shops </span></td>
                      <td><span class="style5"></span></td>
                    </tr>
                </table></td>
              </tr>
              <tr>
                <td bgcolor="#B4D9F1"><span class="style5">Message for us </span></td>
                <td bgcolor="#B4D9F1"><textarea name="textfield3" cols="58" rows="7" class="inputz2"></textarea></td>

              </tr>
            </table>
            <p><span class="style1">
              <input type="submit" name="Submit" value="Submit" />
            </span></p>
          </form>
</body>
</html>


Look, I have written this code in a hurry.. So I didnt give any type of validation in the form. So please check it.

Thanks
Bachan

Post Reply