Hi,
I am working on the following piece of code (which I found on the internet)
to allow me to populate dropdowns dynamically from a mysql database. There
are a number of associated Javascript files that are part of this code (which I
don't really understand but work fine). The question I have inrelation to this
code is how do I convert the options that are choosen in the dropdowns into
sessions as I will need to pass these variable on to other pages.
------------------------------ Code -------------------------------------
<html>
<head>
<title>JSRS Select Demo</title>
<script language="javascript" src="jsrsClient.js"></script>
<script language="javascript" src="selectphp.js"></script>
</head>
<?php
$make = isset($_POST['lstMake']) ? $_POST['lstMake'] : -99;
$model = isset($_POST['lstModel']) ? $_POST['lstModel'] : -99;
$options = isset($_POST['lstOptions']) ? $_POST['lstOptions'] : -99;
?>
<body onload="preselect('<?php echo $make;?>', '<?php echo $model;?>', '<?php echo $options;?>', 1);"
onhelp="jsrsDebugInfo();return false;">
<form name="QForm" method="post" action="./test.php">
<table class="normal" width="575" BORDER="0" CELLSPACING="2" CELLPADDING="2" VALIGN="TOP">
<?php
SelectBox ("Make", "lstMake");
SelectBox ("Model", "lstModel");
SelectBox ("Options", "lstOptions");
?>
</table>
<input type="submit" name="cmdSubmit" value="Submit" id="cmdSubmit" title="Show selects with preselected values" style="" /><br />
</form>
</body>
</html>
----------------------------- End of code -------------------------------
Regards & Thanks
Graham
I am working on the following piece of code (which I found on the internet)
to allow me to populate dropdowns dynamically from a mysql database. There
are a number of associated Javascript files that are part of this code (which I
don't really understand but work fine). The question I have inrelation to this
code is how do I convert the options that are choosen in the dropdowns into
sessions as I will need to pass these variable on to other pages.
------------------------------ Code -------------------------------------
<html>
<head>
<title>JSRS Select Demo</title>
<script language="javascript" src="jsrsClient.js"></script>
<script language="javascript" src="selectphp.js"></script>
</head>
<?php
$make = isset($_POST['lstMake']) ? $_POST['lstMake'] : -99;
$model = isset($_POST['lstModel']) ? $_POST['lstModel'] : -99;
$options = isset($_POST['lstOptions']) ? $_POST['lstOptions'] : -99;
?>
<body onload="preselect('<?php echo $make;?>', '<?php echo $model;?>', '<?php echo $options;?>', 1);"
onhelp="jsrsDebugInfo();return false;">
<form name="QForm" method="post" action="./test.php">
<table class="normal" width="575" BORDER="0" CELLSPACING="2" CELLPADDING="2" VALIGN="TOP">
<?php
SelectBox ("Make", "lstMake");
SelectBox ("Model", "lstModel");
SelectBox ("Options", "lstOptions");
?>
</table>
<input type="submit" name="cmdSubmit" value="Submit" id="cmdSubmit" title="Show selects with preselected values" style="" /><br />
</form>
</body>
</html>
----------------------------- End of code -------------------------------
Regards & Thanks
Graham