开发者

calling dropdown through ajax

开发者 https://www.devze.com 2023-01-18 06:19 出处:网络
hii everybody, i want to show dropdown box calling from another dropdown. when one is selected, another dropdown will be called from database values. i am using this code开发者_开发技巧 :

hii everybody, i want to show dropdown box calling from another dropdown. when one is selected, another dropdown will be called from database values. i am using this code开发者_开发技巧 :

echo $fginfo=" <td width='150' class='label'>Items</td>
                <td class='content' colspan='3'> 

                <select name='item_code' id='item_code' onchange=\'checkitemcode();\'>
                    <option value='0'>Select Item</option>".
                    $sql12=mysql_query('select * from item_master_raw where status=1 order by item_name asc ');
                     while($row12 = mysql_fetch_array($sql12)) 
                    { "<option value='$row12[item_code_rw]'>$row12[item_name]</option>".}"
                    </select>
                </td>";

but the values from the database are not seen. plz help me. thanks.


Lol, try this:

<td width='150' class='label'>Items</td>
                <td class='content' colspan='3'> 

                <select name='item_code' id='item_code' onchange=\'checkitemcode();\'>
                    <option value='0'>Select Item</option>"
<?php
                    $sql12=mysql_query('select * from item_master_raw where status=1 order by item_name asc ');
                     while($row12 = mysql_fetch_array($sql12)) 
                    { 
                       echo "<option value='$row12[item_code_rw]'>$row12[item_name]</option>";
                    }
?>

                    </select>
                </td>
0

精彩评论

暂无评论...
验证码 换一张
取 消