Okay I have a couple of select boxes. When the user clicks on the first select box the form is submitted to itself and I retrieve the value of the selection and make my "select" box into a plain textbox with the value that the user selected. Now my second select box is filtered based on the selection of the first select box. This works great. My problem is that I do more of this later in the form and every time I submit the form to itself my first select box changes values. How can I make the value a constant number?
example of what I have is
<?php
$ckSubmit=$HTTP_POST_VARS['ckSubmit']+1;//Here I am declaring variables that occur after the form has been posted
$industry=$HTTP_POST_VARS['selectIndustry'];
$ind=get_ind_string($industry);
$prarea=$HTTP_POST_VARS['selectPrArea'];
$prarea1 = get_prarea_string($prarea);
if ($ckSubmit>4){
$doSubmit='poreport2.php';}
elseif ($ckSubmit<4){
$doSubmit=$_SERVER['PHP_SELF'];}
?>
<html>
<head>
<title>PROJECT OPENING REPORT</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#CCCCCC">
<table width="631" height="143" border="0">
<tr>
<td width="332" height="137"><img src="intranet_01.jpg" name="Image1" width="300" height="50" id="Image1"><img src="intranet_03.jpg" name="Image2" width="300" height="50" id="Image2"></td>
<td width="283"> <div align="center"><strong><font size="5">Project Opening
Report</font></strong></div></td>
</tr>
</table>
<form name="form1" method="POST" action="<?php echo $doSubmit;?>" >
<table width="95%" border="1" align="center">
<tr>
<td colspan="3"><strong>Service Code:
<?php if ($ckSubmit>2) {?>
<input name="txtSelectIndustry" type="text" id="txtSelectIndustry" value="<?php echo $ind;?>">
<?php } else {?>
<select name="selectIndustry" style="width:20%" size="1" id="selectIndustry">
<option value="2">Electric</option>
<option value="4">IT</option>
<option value="6">Natural Gas</option>
<option value="7">Other</option>
<option value="8">Telecom</option>
<option value="9">Wtr & WasteWtr</option>
</select>
<?php }?>
<?php if ($ckSubmit>2) {?>
<input name="txtPrArea" type="text" id="txtPrArea" value="<?php echo $prarea1;?>">
<?php } else {?>
<select name="selectPrArea" id="selectPrArea" style="width:30%" onchange="document.form1.submit()">
<option value="05">Acquisition, Consolidation, Priv & Valuation</option>
<option value="10">Antitrust & Mkt Analysis</option>
<option value="15">Billing, Metering & Data Collection & Processing</option>
<option value="20">Cost of Capital & Regulatory Econ</option>
<option value="25">Cost of Service & Rates</option>
<option value="30">Econometric Forecasting & Statistical Analysis</option>
<option value="35">Education and Training</option>
<option value="40">Financial Forecasting & Analysis</option>
<option value="50">Industry Restructuring & Retail Competition</option>
<option value="70">Resource Planning & Procurement</option>
<option value="75">Software Sales & Support</option>
<option value="80">Strategic Planning & Analysis</option>
<option value="90">Transmission Planning & Analysis</option>
</select>
<?php }?>
</td>
</tr>
</table>
<p>
<input type="submit" name="Submit" value="Submit" >
</p>
<input type="hidden" name="ckSubmit" value="<?php echo $ckSubmit; ?> ">
</form>
</body>
</html>