Click to See Complete Forum and Search --> : Dynamic options


dli
01-22-2003, 03:51 PM
<html>
<body>
Please VIEW it as an HTML doc for clarity, thanks.<P>

Goal:
Display dynamic options.
Description:
<pre>
First, display 4 (1,2,3,4) options upon any "order" column
selection; then present the remaining 3 options,
which could be 2,3,4 if first selection is 1
or 1,3,4 if first selection is 2
or ...;
same pattern for the rest.
</pre>

<table>

<tr>
<td colspan="4" align="right"><font color="Green"><b>Column Order</b></font></td>
<td colspan="4" align="right"><font color="Green"><b>Column Order</b></font></td>
</tr>

<tr>


<td align="right" valign="top"><font color="blue">1</font>
CUSTOMERID: <input type="checkbox" name="col" value="CustomerID">
<br>
</td>
<td colspan="3" align="right" valign="top">
<select name="colOrder_CustomerID" onChange='ops(this)'>
<option value="">
<option>1
<option>2
<option>3
<option>4
</select>
</td>

<td align="right" valign="top"><font color="blue">2</font>
COMPANYNAME: <input type="checkbox" name="col" value="CompanyName">
<br>
</td>
<td colspan="3" align="right" valign="top">
<select name="colOrder_CompanyName" onChange='ops(this)'>
<option value="">
<option>1
<option>2
<option>3
<option>4
</select>
</td>

</tr>

<tr>
<td align="right" valign="top"><font color="blue">3</font>
CONTACTNAME: <input type="checkbox" name="col" value="ContactName">
<br>
</td>
<td colspan="3" align="right" valign="top">
<select name="colOrder_ContactName" onChange='ops(this)'>
<option value="">
<option>1
<option>2
<option>3
<option>4
</select>
</td>

<td align="right" valign="top"><font color="blue">4</font>
CONTACTTITLE: <input type="checkbox" name="col" value="ContactTitle">
<br>

</td>
<td colspan="3" align="right" valign="top">
<select name="colOrder_ContactTitle" onChange='ops(this)'>
<option value="">
<option>1
<option>2
<option>3
<option>4
</select>
</td>

</tr>

<tr>

<td align="right" valign="top"><font color="blue">5</font>
ADDRESS: <input type="checkbox" name="col" value="Address">
<br>
</td>
<td colspan="3" align="right" valign="top">
<select name="colOrder_Address" onChange='ops(this)'>
<option value="">
<option>1
<option>2
<option>3
<option>4
</select>
</td>

<!-- check col alias -->
<td align="right" valign="top"><font color="blue">6</font>
CITY: <input type="checkbox" name="col" value="City">
<br>
</td>
<td colspan="3" align="right" valign="top">
<select name="colOrder_City" onChange='ops(this)'>
<option value="">
<option>1
<option>2
<option>3
<option>4
</select>
</td>
</tr>

</table>

<pre>
psuedo code:
// option length
preset opLen = document.form[0].{opCol?}.options[0].length = 4;
// option selection list
preset opSelList = '';
upon each selection
set opLen = opLen - 1;
set opSelList = append(opSelList,current selection);

for (var i = 0; i < opLen; i++) {
if (document.form[0].{opCol?}.options[i].selected NOT IN opSelList) {
document.write('<option>'+i);
}
// js code to be embeded inside FORM select element?
</pre>
<p>

Thanks.
</body>
</html>


Also, how to set "HTML code (to) ON"? I don't see any option for that.

khalidali63
01-22-2003, 07:52 PM
I think if your question was a bit more descriptive that what is it you want, some one would have been able to respond to you.

cheers

Khalid

dli
01-23-2003, 08:35 AM
Thanks for the response, please visit URL,
http://www.hegelsoftware.com/ToDo/dynamicOptions.html,
which presents the problem in easy-to-understand manner.

Regards,

Don

khalidali63
01-23-2003, 10:42 AM
the link has nothing more then what you have posted here.

dli
01-23-2003, 11:11 AM
Do you understand my question / the problem?

dli
01-27-2003, 02:29 PM
Khalid, what more detail do you require? Thanks. Don