Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 251
  • Last Modified:

ho do I make Php to handle drop down and radio button chained effect

I tried something and my php code is here

<?php
$sqls = "SELECT * FROM `option_contents` WHERE `optiontype` = '1' AND `option_name_id` = '3'";
$runquery = mysql_query($sqls,$con);
    while($data = mysql_fetch_assoc($runquery))
    {
    ?>
    <input type="radio" name="Sauce3" value="<?php echo $data['value']; ?>"  onchange="showStuff('answer1'); return false;">
    <span><?php echo $data['value']; ?> </span><br/>
    <div id="answer1" style="display: none; margin-left:25px;">
        <select name="HDSIZE">
            <option selected="" value="500GBSATAHD">500 GB 7200 RPM SATA hard drive (+$0/month)</option>
            <option value="1000GBSATAHD">1TB 7200 RPM SATA hard drive (+$20/month)</option>
            <option value="2000GBSATA">2 TB SATA (5,900 rpm) (+$40/month)</option>
        </select>
    </div>
    <?php
     }
    ?>

But this isn't working correctly.

I have four radio button and their values comes from while loop data comes from DB.
.I want to add radio button's onclick drop menu and drop down menu will change onclick radio button action .

Help is appreciated.
0
shawnlearn
Asked:
shawnlearn
1 Solution
 
mankowitzCommented:
sorry-- I'm confused here. What are you trying to do?
The above script will print out one radio button and one select menu for each row of your database. What  would you like it to do?
0
 
shawnlearnAuthor Commented:
Thank you
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now