Time:
Scotland: Fri, 9:32 pm
Rhode Island: Fri, 4:32 pm
Florida: Fri, 4:32 pm
New Mexico: Fri, 2:32 pm
California: Fri, 1:32 pm

Click here to visit Livelife365.com

Click here to visit nmdarts.com



Buy this Ad Space.

180px wide.

Please get in touch with KH@ if you are interested and make an offer.

CLICK HERE TO GET AUCTION BAR NOW
US$10 per year - Save $100s!
The Fabulously Unfair
WebX Auction Bar. For Ebay etc.
Ro-Sham-Bo the opposition. Laugh like Eric Cartman when you win! CLICK HERE NOW!


More information and sign-up.

WebXpertz Hosting.
Custom fit from $5pm. PHP/MySQL
You'll save money, we'll save money. Seems fair to me. Interested? If so Please PM me here and tell me what you need. Thanks!


Please click here for more information

For continued disscussion on this topic : change SELECT box contents upon button click?


Raimund
01-30-2002, 02:03 PM
Hi there,
I'd like JavaScript to display different options within a select box, depending on which button the user clicked.

Want more details? Here they come ... :D
I'm using ColdFusion and SQL Server to query a database and to dynamically display the results on our web page.

<CFQUERY NAME="test" DATASOURCE="#local_DBA#">
SELECT foo, bar
FROM testtable
WHERE (foo = 'true');
</CFQUERY>

<!-- this way, the database table 'testtable' is queried for the columns 'foo' and 'bar' such that the result variable (an array called 'test') may contain multiple entries when 'foo' was true. //-->

<FORM name=myform>
<SELECT name="selectbox" SIZE=10 multiple>
<CFOUTPUT QUERY="test">
<OPTION value="#bar#">
</CFOUTPUT>
</SELECT>
</FORM>

<!-- here the result is displayed within a select box, the <CFOUTPUT></CFOUTPUT>-block is necessary to access the ColdFusion array 'test'.
//-->

:confused: Now, I'd like to add two buttons and to fill in different query results into the SELECT box depending on which button the user clicked.
So, the question is, how do I exchange the value of the "test" array variable upon a button click? Is this possible with JavaScript?

Thanks a lot in advance & happy coding,
Rai. :)

jonsteele
01-30-2002, 04:16 PM
Is this (http://www.mattkruse.com/javascript/dynamicoptionlist/) what you need? :)

Jon

Vincent Puglia
01-30-2002, 04:32 PM
Hi Rai & welcome to the City that changes its options every day :D

You might also be interested in the "Cascading Selects (I & II)" scripts/tutorials at my site (GrassBlade)

Vinny

Jack Michaelson
01-30-2002, 04:54 PM
Speaking of GrassBlade...

I'm getting a 'Server too busy' error.

mmi
01-30-2002, 04:58 PM
I think it's a combination of the warm weather we've been gettin' here in the Northeast and all that fertilizer Vinny's been spreadin' around :haha:

Vincent Puglia
01-30-2002, 06:09 PM
To one and all,


I find myself in the position of having to apologize for America's favorite, easiest-to-use ISP -- Almost OnLine

I have been in contact with the human parrots at the AOL techie department since 1/17 (at least) On occasion, they have told me it is a "Host Related Issue" , but refused to provide me with a 'resolved' date.

The only thing I can say is: keep trying. It occasionally comes back online.

Jack: believe it or not, I'm so happy you posted that. I was beginning to believe the aol techies and think it was my machine

mmi: it's aol who is spreading the fertililzer

Any further comments on my plight, should be posted at:
this link (http://www.webxpertz.net/forums/showthread.php?t=13770)

btw: does anyone think I have a chance at a damages suit?

Vinny