Help with getting the value of a dropdown box within a radio

Hi guys, completely new to PHP here and I am stuck somewhere and would appreciate some advice.

I have a couple of radio buttons which has an onclick feature to them. Within each of these radio buttons there are sub-dropdown boxes. What I want to do is when I click on the radio option and then subsequently choose an option from the drop down box, I need the values of the drop down boxes as well within the email that will be sent out. At the moment, all I get is the radio button value passed into my email (probably because that’s all I am calling at the moment). I have no idea on how to get the values of the drop down boxes in conjuction with the radio button values.

At the moment all I get within my email is this:

Server Specs : Virtual Machine (if I choose the Virtual Machine radio option)

Attached is a snipet of the code that I am using.

HTML Code:

<label class="description" for="machine">Machine Type </label>
       
        <span>
            <input id="Virtual Machine" name="machine" class="element radio" type="radio" value="Virtual Machine" onclick="showstuff('vmdiv'); hidestuff('physdiv');"/>
            <label class="choice" for="Virtual Machine" >Virtual Machine</label>
       
        <div id="vmdiv" style="display:none">
        <font color="#4C787E">   
        <br>Operating System:<br>
            <select name="Virtual Machine">
            <option value="none">None</option>   
            <option value="Windows Server 2003">Windows Server 2003</option>
            <option value="Windows Server 2008">Windows Server 2008</option>
            </select>
        <br>

        <br>Storage Pool:<br>
            <select name="Virtual Machine">
            <option value="cpenas">CPE NAS (standard data pool)</option>   
            <option value="pool2">pool2</option>
            <option value="pool3">pool3</option>
            </select><br>   
        </font>   
        </div>
       
            <input id="Physical Machine" name="machine" class="element radio" type="radio" value="Physical Machine" onclick="showstuff('physdiv'); hidestuff('vmdiv');"/>
            <label class="choice" for="Physical Machine">Physical Machine</label>
       
        <div id="physdiv" style="display:none">
        <font color="#4C787E">           
        <br><b>Physical Machine</b>
            <input type="text">
            </font>
        </div>
        </span>


and the php for the email that I am using is

PHP Code:


<?php
//error_reporting (E_ALL ^ E_NOTICE);
$errors '';
$machine '';

if(isset($_POST['submit']))
{
$machine $_POST['machine'];
}

if( empty($errors))
{
    
$email_subject "New Server Order Form submission\n";
    
$email_body "You have received a NEW SERVER ORDER.\n";
    
$email_body .= "\n Server Specs:" .$machine;
    
$to "abc@somemail.com";      

    mail($to$email_subject$email_body);

    header('Location: New form thank you.html');
}



So my basic requirement is to get something like this in my email if I choose Virtual machine and its sub options

Server Specs : Virtual Machine Windows Server 2003 pool2

Thanks for the help. I did a brief search through the site but I did not know what exactly to look for.

View full post on Tycoon Talk

, , , , ,

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Get Adobe Flash playerPlugin by wpburn.com wordpress themes


RSS Site FeedRSS Site Feed

© 1992-2011 DC2NET™, Inc. All Rights Reserved