Using the selectedIndex property of <SELECT> 
Author Message
 Using the selectedIndex property of <SELECT>

Has anyone use this 'onchange' logic below to trap the value the user
selected from the options list of a <SELECT> statement? I got this from
msdn but I can't seem to get it to work. I'm trying to feed the selected
value into another select pulldown listbox w/o having to post/get the
form. Can this be done in VBScript?

 onchange="window.location.href=this.options[this.selectedIndex].value"

Kevin Struckhoff

*** Sent via Developersdex http://www.*-*-*.com/ ***
Don't just participate in USENET...get rewarded for it!



Sat, 17 Jul 2004 07:09:10 GMT  
 Using the selectedIndex property of <SELECT>
this looks OK to me. I usually use a function which checks for null or
blank values so I can have options which *don't* take you off places.

I wouldn't use VBScript client-side - it's non-interoperable.

what values do you have in the '<option>' tags?

Atrax - MVP [Microsoft Most Valued Professional]

http://www.infinitemonkeys.ws/

Host with me for $100 a year!
http://www.atrax.ws/hosting/

please do not reply directly to this email address

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Sat, 17 Jul 2004 10:45:12 GMT  
 Using the selectedIndex property of <SELECT>
Can you use 'this' in VBScript?

Bill Wallace

Quote:

> this looks OK to me. I usually use a function which checks for null or
> blank values so I can have options which *don't* take you off places.

> I wouldn't use VBScript client-side - it's non-interoperable.

> what values do you have in the '<option>' tags?

> Atrax - MVP [Microsoft Most Valued Professional]

> http://www.infinitemonkeys.ws/

> Host with me for $100 a year!
> http://www.atrax.ws/hosting/

> please do not reply directly to this email address

> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!



Sat, 17 Jul 2004 13:28:40 GMT  
 Using the selectedIndex property of <SELECT>
possibly not, but you'll notice i specifically recommended against using
VBScript on the client. just use the default javascript.

Atrax - MVP [Microsoft Most Valued Professional]

http://www.infinitemonkeys.ws/

Host with me for $100 a year!
http://www.atrax.ws/hosting/

please do not reply directly to this email address

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Sat, 17 Jul 2004 13:53:06 GMT  
 Using the selectedIndex property of <SELECT>
In VBScript, use Me where you would use this in JavaScript...

And it's OK to use VBScript on the client side if you know you have an IE only audience as if often the case in corporate Intranet scenarios.

--
Michael Harris
Microsoft.MVP.Scripting
--

Quote:

> Can you use 'this' in VBScript?

> Bill Wallace


> > this looks OK to me. I usually use a function which checks for null or
> > blank values so I can have options which *don't* take you off places.

> > I wouldn't use VBScript client-side - it's non-interoperable.

> > what values do you have in the '<option>' tags?

> > Atrax - MVP [Microsoft Most Valued Professional]

> > http://www.infinitemonkeys.ws/

> > Host with me for $100 a year!
> > http://www.atrax.ws/hosting/

> > please do not reply directly to this email address

> > *** Sent via Developersdex http://www.developersdex.com ***
> > Don't just participate in USENET...get rewarded for it!



Sat, 17 Jul 2004 14:00:19 GMT  
 Using the selectedIndex property of <SELECT>
thank you for stating VBScript is fine in a homogenous environment.
however, all too often it's used in the wild by folks who don't know
better. It's always worth recommending against, because somebody may
well be planning to use it in the wild.

Atrax - MVP [Microsoft Most Valued Professional]

http://www.infinitemonkeys.ws/

Host with me for $100 a year!
http://www.atrax.ws/hosting/

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Sat, 17 Jul 2004 14:09:08 GMT  
 Using the selectedIndex property of <SELECT>
Hey that works.  Is it documented? The only thing
I could find was syntax error 1037 "Invalid use
of the Me keyword".  But it works so I guess it
doesn't matter.  Thank You once again.

guess how many hits when I searched for " me " +dhtml
oodles

Bill Wallace



In VBScript, use Me where you would use this in JavaScript...
--snip--
--
Michael Harris
Microsoft.MVP.Scripting



Sun, 18 Jul 2004 10:15:43 GMT  
 Using the selectedIndex property of <SELECT>
It isn't documented for VBScript but it is for VB where is has the general meaning of "the current object context".  Of course what that resolves to varies based "the current event context".

In any case, some general knowledge of VB has been assumed by whomever wrote the VBScript docs, parts of which are lifted almost verbatim from the VB docs.  And those who write the IE docs don't think in VBScript terms.  

--
Michael Harris
Microsoft.MVP.Scripting
--

Quote:

> Hey that works.  Is it documented? The only thing
> I could find was syntax error 1037 "Invalid use
> of the Me keyword".  But it works so I guess it
> doesn't matter.  Thank You once again.

> guess how many hits when I searched for " me " +dhtml
> oodles

> Bill Wallace



> In VBScript, use Me where you would use this in JavaScript...
> --snip--
> --
> Michael Harris
> Microsoft.MVP.Scripting



Mon, 19 Jul 2004 06:13:42 GMT  
 Using the selectedIndex property of <SELECT>
That's interesting.  Thnx.

Bill Wallace


It isn't documented for VBScript but it is for VB where is has the general
meaning of "the current object context".  Of course what that resolves to
varies based "the current event context".

In any case, some general knowledge of VB has been assumed by whomever wrote
the VBScript docs, parts of which are lifted almost verbatim from the VB
docs.  And those who write the IE docs don't think in VBScript terms.

--
Michael Harris
Microsoft.MVP.Scripting
--


Quote:
> Hey that works.  Is it documented? The only thing
> I could find was syntax error 1037 "Invalid use
> of the Me keyword".  But it works so I guess it
> doesn't matter.  Thank You once again.

> guess how many hits when I searched for " me " +dhtml
> oodles

> Bill Wallace



> In VBScript, use Me where you would use this in JavaScript...
> --snip--
> --
> Michael Harris
> Microsoft.MVP.Scripting



Mon, 19 Jul 2004 10:28:21 GMT  
 
 [ 9 post ] 

 Relevant Pages 

1. <<<<<<<<ComboBox>>>>>>>>>>>>

2. --------<<<<<<MONEY>>>>>>--------- id 9543

3. HELP >>>>>>WIN API <<<<<<<<<<

4. help me out please!!!!<<<<<<<<<<<<<<<<<<<<<<<thanks>>>>>>>>>>>>>>>>>>>>>>>>

5. <><><>HELP<><><> PCMCIA Motorola Montana 33.6

6. <<<<HELP- OLE container Control>>>>>>>>>

7. VB5<->RDO2<->ODBC<->ORACLE Procedure Problem

8. <<<Cneck Box>>>

9. <<<Gif Files>>>

10. <<<CD ROM>>>

11. <<<Win32Api.TXT>>>

12. <<<NetWork Drv>>>

 

 
Powered by phpBB® Forum Software