Link to home
Start Free TrialLog in
Avatar of shawnlearn
shawnlearnFlag for India

asked on

In php, I have four radio button and their values comes from while loop data comes from DB.I need add radio button's onclick one drop menu .

In php, I have four radio button and their values comes from while loop data comes from DB.I need add radio button's onclick drop menu and drop down menu will change onclick radio button action .
Avatar of boon86
boon86
Flag of Malaysia image

you need onChange="someaction();"
Avatar of shawnlearn

ASKER

<?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
     }
    ?>
This is my code. How is it mange or call i function . nOw i used static drop menu for testing after code working i will add dynamic code will use. Tell me how i do ?
ASKER CERTIFIED SOLUTION
Avatar of maeltar
maeltar
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you for your help.