I want to display what the user has already submitted before in a form.
I am having problem displaying this select list.
My list is such a way that when the user choose CARS, another set of select options will be displayed and if BIKES is chosen there will be another set....
this code is on my edit page... I want to see what the user has chosen before.... I can only do it for the first select list... but cannot display whatever is it in the 2nd list
To get the <select> options to jump to the right ones when the page first loads you could set <body onload="SetupOptions()"> and then use something like this...
<head>
<script type="text/javascript">
function SetupOptions()
{
SetupSelect("myForm", "mySelect", 2);
SetupSelect("myForm", "anotherSelect", 5);
}
function SetupSelect(formName, selectName, optionNumber)
{
// formName = The name of the <form>
// selectName = The name of the <select> object
// optionNumber = The <option> number which is to be selected
eval("document.forms." + formName + "." + selectName + ".optionsї" + optionNumber + "].selected='selected'");
}
</script>
</head>