Drop Downs - dynamically populating from array based on previous data

G

g

Hi,

I'm having an issue with SQML and javascript.

Essentially, a page loads up and a dropdown is populated from a
database with every product. However, if a user has entered an order
code (in a prompt box on page load) the dropdown will only display a
list of products available to him/her.

Any idea how i use an array to dictate the values of the dropdown.

Code snippets so far...

Initial dropdown on load...
<td><select name=s1 onChange="fnDisplayCost();fnCheckSerial();">
<option>Please select...
<DATASET DBID=wavecrest TABLE=T06Product
ITEM=T06Product_Code,T06RRP,T06Max_Retail_Discount,T06Product_Description
ORDER=T06Product_Code>
<option value='<DATA INDEX=1 ESCAPE>|<DATA INDEX=2 ESCAPE>|<DATA
INDEX=3 ESCAPE>'><DATA INDEX=4>
</DATASET>
</select>

I then load an array (based on what a user enters) with say values x
and y and essentially I want to do the following.

For (x=0;x<myArray.length-1;x++)
{
document.s1.options[x].value=myArray[x,1]
}

and the dropdown no long displays the original values, it displays the
values specified by myArray.

Does this make sense? If not, let me know and i'll attempt to descibe
it a little better.

Thanks for any help
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top