| | |
two commbox problem
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
hi all,
i made two commbox in my page cropcat,subcat.my coding is below.when i select a item form cropcat related subcat fetch from database mysql and displayed.but my problem here is that when i select item form cropcat page refresh and selected value not display in cropcat ?please help me
i made two commbox in my page cropcat,subcat.my coding is below.when i select a item form cropcat related subcat fetch from database mysql and displayed.but my problem here is that when i select item form cropcat page refresh and selected value not display in cropcat ?please help me
PHP Syntax (Toggle Plain Text)
<form name="form1" id="form1" method="post" action="<?php echo $_SERVER['PHP_SELF']?>"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="18%"> </td> <td width="71%"> </td> <td width="5%"> </td> <td width="6%"> </td> </tr> <tr> <td><select name="cropcat" id="cropcat" onchange=oneG()> <option value="0">Select Crop...</option> <option value="OffSeasonVEG">OffSeasonVEG</option> <option value="MedicinalPlants">MedicinalPlants</option> <option value="Floriculture">Floriculture</option> <option value="Pulses">Pulses</option> </select></td> <td><span class="style121"> <?php // echo "Connected MySql"; $cc=$_POST['cropcat']; //echo "ccc".$cc; $res1 = mysql_query("SELECT subcat FROM crop_detail where cropcat='$cc'") or die("Invalid query: " . mysql_query()); //echo ".mysql_query()"; echo '<select id="gp" name="gp" onchange=oneG()>'; echo '<option value="">select...</option>'; while ($row1= mysql_fetch_array($res1)) { $g = $row1['subcat']; echo "<option value='$g'>$g</option>"; } echo '</select>'; ?> </span></td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> </tr> </table> </form> .................. <script language="javascript"> function oneG() { document.form1.submit(); } </script>
Last edited by peter_budo; Nov 5th, 2008 at 9:00 pm. Reason: Correcting code tags, please use [code] not <code>
![]() |
Other Threads in the PHP Forum
- Previous Thread: PHP Form Validation ???
- Next Thread: How to make website submitter??
Views: 375 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array beginner binary broken cakephp checkbox class cms code cron curl database date directory display download dynamic echo email encode error file files folder form forms function functions google howtowriteathesis href htaccess html image include insert integration ip java javascript joomla jquery limit link login loop mail menu methods mlm mod_rewrite multiple multipletables mysql oop parse paypal pdf php problem provider query radio random recursion regex remote script search select server sessions sms soap source space speed sql structure syntax system table template tutorial update updates upload url validation validator variable video web xml youtube





