Connecting Tech Pros Worldwide Help | Site Map

Drop Downs - dynamically populating from array based on previous data

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 23rd, 2005, 07:50 PM
g@area404.org
Guest
 
Posts: n/a
Default Drop Downs - dynamically populating from array based on previous data

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


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.