Wrox Programmer Forums
|
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Dreamweaver (all versions) section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 11th, 2005, 03:17 AM
Friend of Wrox
 
Join Date: May 2005
Posts: 201
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to hastikeyvan
Default option values

hello all
how can we access to select values?i have a select menu and i want to give its option values myself.is this code right?
<script for="select1" language=vbscript event="unchange">
if select1.value=s then
select2.value=s
cant it give values to options of select2 menu?????
if anyone knows the solution please tell me too
thank you

 
Old October 11th, 2005, 02:46 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi ,

Take a look at this FAQ: http://Imar.Spaanjaars.Com/QuickDocId.aspx?QUICKDOC=292

It explains how to do this with JavaScript (which is cross-browser while VB Scripts isn't) but I think you'll see how to use it.

Also, make sure you change unchange to onchange.

HtH,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old October 12th, 2005, 04:57 AM
Friend of Wrox
 
Join Date: May 2005
Posts: 201
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to hastikeyvan
Default

thank you for your help.i studied the page you send its link but i think that program sends exactly what we wrote in our texbox to select menu.but i want to have something like dependent menus with static values not dynamic
for this cas can i use the code i wrote it before????

 
Old October 13th, 2005, 01:19 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

I am not sure what you're trying to accomplish

Do you have multiple linked listboxes? E.g. list two changes when you select a value from list 1?

If so, are you doing this server side or client side? On the server you can look at the value for list one and then determine the items for list two, while at the same time, preselecting the item in list one again.

You can do the same with client side code, using the FAQ I linked you to.

Or re you trying to create entirely new option elements in the second drop-down? In that case, search Google for JavaScript and "new option". You'll find articles similar to this one:

http://www.quirksmode.org/js/options.html

HtH,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Create Check Boxes/Option buttons/Option Group hewstone999 Access VBA 1 March 14th, 2008 07:25 AM
if option kgoldvas XSLT 1 May 14th, 2007 09:39 AM
C# and WinXP Customize Regional Option Values slau C# 1 May 3rd, 2007 07:20 AM
option values hastikeyvan Dreamweaver (all versions) 6 September 23rd, 2005 11:56 PM
loop values and text box values move mateenmohd Classic ASP Basics 2 April 5th, 2005 11:33 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.