Solved

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

Posted on 2011-09-05
3
245 Views
Last Modified: 2012-05-12
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
Comment
Question by:shawnlearn
3 Comments
 
LVL 11

Accepted Solution

by:
maeltar earned 500 total points
ID: 36483722
0
 
LVL 24

Expert Comment

by:mankowitz
ID: 36483788
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
 
LVL 1

Author Closing Comment

by:shawnlearn
ID: 36495957
Thank you
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
What's wrong with this PDO query? 5 27
Insert Button on a table 16 38
PHP alternative to file_get_contents('php://input') 4 70
How do I show metrics with PHP or Javascript 6 33
This article discusses how to create an extensible mechanism for linked drop downs.
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question