Thanks Guys just what I wanted.

-----Original Message-----
From: Steve Onnis [mailto:[EMAIL PROTECTED] 
Sent: Monday, 8 November 2004 3:59 PM
To: CFAussie Mailing List
Subject: [cfaussie] RE: OT Javascript

Ayudh

you dont have to specify text/value values

you can use new Option(value,text)

do

selectBox.option[1] = new Option(value,text)

steve

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Ayudh
Nagara
Sent: Monday, November 08, 2004 4:49 PM
To: CFAussie Mailing List
Subject: [cfaussie] RE: OT Javascript




I presume you mean populating a select box without refreshing the page from
the server? Here are the bare bones of the javascript to do the job.

Start with an empty box:
<FORM NAME="myform" METHOD="POST" ACTION="whatever">
<SELECT NAME="myselection" SIZE=1>
<OPTION VALUE="">Select your drink</OPTION>
</SELECT>
</FORM>

Then use the following javascript to increase the number of options and
populate them (normally you would store these values in an array and loop
over it):

document.myform.myselection.length = 4;
document.myform.myselection.options[1].value = "Margarita";
document.myform.myselection.options[1].text = "Margarita";
document.myform.myselection.options[2].value = "Pina Colada";
document.myform.myselection.options[2].text = "Pina Colada";
document.myform.myselection.options[3].value = "Vodka Lime";
document.myform.myselection.options[3].text = "Vodka Lime";

You can also fetch these options from the server using remote scripting.

Regards: Ayudh

+----------------------------------------------------------------+
| SOAP is the glue! Hook up your server directly to your bank.   |
| Connect to VeriPay xServ, the Australian Payments Web Service. |
| Reliable, Secure, FAST: http://www.xilo.com/xserv              |
+----------------------------------------------------------------+



---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to
[EMAIL PROTECTED]
Aussie Macromedia Developers: http://lists.daemon.com.au/



---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
Aussie Macromedia Developers: http://lists.daemon.com.au/


-----------------------------------------------------------------------------------
This e-mail is sent by Suncorp-Metway Limited ABN 66 010 831 722 or one of its 
related entities ("Suncorp"). 

Suncorp may be contacted at Level 18, 36 Wickham Terrace, Brisbane or on 13 11 
55  or at suncorp.com.au.

The content of this e-mail is the view of the sender or stated author and does 
not necessarily reflect the view of Suncorp. The content, including 
attachments, is a confidential communication between Suncorp and the intended 
recipient. If you are not the intended recipient, any use, interference with, 
disclosure or copying of this e-mail, including attachments, is unauthorised 
and expressly prohibited. If you have received this e-mail in error please 
contact the sender immediately and delete the e-mail and any attachments from 
your system.

If this e-mail constitutes a commercial message of a type that you no longer 
wish to receive please reply to this e-mail by typing Unsubscribe in the 
subject line.


---
You are currently subscribed to cfaussie as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]
Aussie Macromedia Developers: http://lists.daemon.com.au/

Reply via email to