Solved

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

Posted on 2011-09-05
3
242 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now