Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>you may need to do something like this</p> <pre><code>&lt;label&gt;Type of Event? &lt;/label&gt; &lt;select id="eventtype" title="" name="eventtype" name="eventtype" class="required select"&gt; &lt;option value=""&gt;Select Your Event Type&lt;/option&gt; &lt;option value="WEDDINGS"&gt;WEDDINGS&lt;/option&gt; &lt;option value="CORPORATE"&gt;CORPORATE EVENT&lt;/option&gt; &lt;option value="SPECIAL"&gt;SPECIAL EVENT&lt;/option&gt; &lt;option value="OTHER"&gt;OTHER SINGLE SERVICES&lt;/option&gt; &lt;/select&gt; &lt;div class="cls"&gt;&lt;/div&gt; &lt;div class="container"&gt; &lt;div class="WEDDINGS"&gt; &lt;label&gt;Package&lt;/label&gt; &lt;select name="WEDDINGSPackage" id="WEDDINGSPackage"&gt; &lt;option value="Day Of Coordination"&gt;Day Of Coordination&lt;/option&gt; &lt;option value="Week of Coordination"&gt;Week of Coordination&lt;/option&gt; &lt;option value="Month of Coordination"&gt;Month of Coordination&lt;/option&gt; &lt;/select&gt; &lt;/div&gt; &lt;div class="CORPORATE"&gt; &lt;label&gt;Package&lt;/label&gt; &lt;select name="CORPORATEPackage" id="CORPORATEPackage"&gt; &lt;option value="Meetings"&gt;Meetings&lt;/option&gt; &lt;option value="Client Appreciation"&gt;Client Appreciation&lt;/option&gt; &lt;option value="Conference &amp;amp; Conventions"&gt;Conference &amp;amp; Conventions&lt;/option&gt; &lt;option value="Corporate Shows"&gt;Corporate Shows&lt;/option&gt; &lt;option value="Employee Appreciation"&gt;Employee Appreciation&lt;/option&gt; &lt;/select&gt; &lt;/div&gt; ....... </code></pre> <p>and at PHP end you have to do something like this</p> <pre><code>if (isset($_POST['eventtype'])) { $subOptSelect = $_POST['eventtype'] . 'Package'; if (isset($_POST[$subOptSelect])){ $sub = $_POST[$subOptSelect]; } } </code></pre> <p>I have prefixed the value of the first select to the sub selects and it becomes easier at php end.</p> <p><strong>Edit:</strong> Here is the code you may require.</p> <pre><code>$package=''; if (!empty($eventtype)) { if (!empty($_POST[$eventtype.'Package'])){ $package = $_POST[$eventtype.'Package']; //$package contains the option selected in the sub option. }else{ //nothing selected in the sub dropdown. you have to add code to handle this } }else{ //nothing selected in the first dropdown. you have to add code to handle this } </code></pre> <p>And your email can be:</p> <pre><code>&lt;table width='95%' cellpadding='0' cellspacing='11'&gt; &lt;tr&gt; &lt;td width='189'&gt;Event Type :&lt;/td&gt; &lt;td&gt;$eventtype&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Package :&lt;/td&gt;&lt;td&gt;$package&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;First Name :&lt;/td&gt;&lt;td&gt;$firstname&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload