Codeman0013
09-21-2006, 02:53 PM
Hey I have 3 questions in one here. First off when my dropdowns submit their value and the page refreshes they go back to their original value which says select a value but I want them to stay on the value the user selects. Also if the user refreshes the page or changes the value of one of the dropdowns I want all the corresponding ones below to automatically repopulate. Finally I want them to be disabled until a user selects the value that will populate it and I am having issues with the if loops. Can someone look at this code and help me with this stuff?
<form name="distributers">
<table class="setTbl listTbl" width="90%" cellpadding="0" cellspacing="0" border="0">
<tr><td>Industry:</td><td>
<select name="industry_id" id="industry" onchange="document.distributers.value='industry';document.distributers.submit();" >
<option value="">Select an Industry...</option>
<?php do { ?>
<option value="<?php echo $row_rs_industry['industry_id']; ?>"><?php echo $row_rs_industry['industry_name']; ?></option>
<?php } while ($row_rs_industry = mysql_fetch_assoc($rs_industry)); ?>
</select></td></tr>
<tr><td>Product category:</td><td>
<select name="productCat_id" id="center" onchange="document.distributers.value='productCat_id';document.distributers.submit();" >
<option value="">Select a product category...</option>
<?php do { ?>
<option value="<?php echo $row_rs_productcategory['productCat_id']; ?>"><?php echo $row_rs_productcategory['productCat_name']; ?></option>
<?php } while ($row_rs_productcategory = mysql_fetch_assoc($rs_productcategory)); ?>
</select>
<tr><td>Products:</td><td>
<select name="product" id="center" onchange="document.distributers.value='products_id';document.distributers.submit();" >
<option value="">Select a product...</option>
<?php do { ?>
<option value="<?php echo $row_rs_product['products_id']; ?>"><?php echo $row_rs_product['products_name']; ?></option>
<?php } while ($row_rs_product = mysql_fetch_assoc($rs_product)); ?>
</select>
<tr><td>State:</td><td>
<select name="state" id="center" >
<option value="">Select a state...</option>
<?php do { ?>
<option value="<?php echo $row_rs_state['state']; ?>"><?php echo $row_rs_state['state']; ?></option>
<?php } while ($row_rs_state = mysql_fetch_assoc($rs_state)); ?>
</select>
</td></tr>
<tr><td> </td><td><input class="PythonButton" type="submit" value="Find" name="{Button_Name}"></td></tr>
</table>
</form>
<form name="distributers">
<table class="setTbl listTbl" width="90%" cellpadding="0" cellspacing="0" border="0">
<tr><td>Industry:</td><td>
<select name="industry_id" id="industry" onchange="document.distributers.value='industry';document.distributers.submit();" >
<option value="">Select an Industry...</option>
<?php do { ?>
<option value="<?php echo $row_rs_industry['industry_id']; ?>"><?php echo $row_rs_industry['industry_name']; ?></option>
<?php } while ($row_rs_industry = mysql_fetch_assoc($rs_industry)); ?>
</select></td></tr>
<tr><td>Product category:</td><td>
<select name="productCat_id" id="center" onchange="document.distributers.value='productCat_id';document.distributers.submit();" >
<option value="">Select a product category...</option>
<?php do { ?>
<option value="<?php echo $row_rs_productcategory['productCat_id']; ?>"><?php echo $row_rs_productcategory['productCat_name']; ?></option>
<?php } while ($row_rs_productcategory = mysql_fetch_assoc($rs_productcategory)); ?>
</select>
<tr><td>Products:</td><td>
<select name="product" id="center" onchange="document.distributers.value='products_id';document.distributers.submit();" >
<option value="">Select a product...</option>
<?php do { ?>
<option value="<?php echo $row_rs_product['products_id']; ?>"><?php echo $row_rs_product['products_name']; ?></option>
<?php } while ($row_rs_product = mysql_fetch_assoc($rs_product)); ?>
</select>
<tr><td>State:</td><td>
<select name="state" id="center" >
<option value="">Select a state...</option>
<?php do { ?>
<option value="<?php echo $row_rs_state['state']; ?>"><?php echo $row_rs_state['state']; ?></option>
<?php } while ($row_rs_state = mysql_fetch_assoc($rs_state)); ?>
</select>
</td></tr>
<tr><td> </td><td><input class="PythonButton" type="submit" value="Find" name="{Button_Name}"></td></tr>
</table>
</form>