Results 1 to 5 of 5

Thread: The great thing about variants

  1. #1

    Thread Starter
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359

    The great thing about variants

    I never liked variants, until I just tried writing out a piece of javascript and it worked perfectly

    Code:
    function doProductAreaChange() {
    	var strSelectedItem = document.search.elements['selProductArea'];
    	strSelectedItem = strSelectedItem.options[strSelectedItem.selectedIndex];
    	strSelectedItem = strSelectedItem.text;
    	alert(strSelectedItem );
    }
    Quite please with myself

  2. #2
    Fanatic Member TheVader's Avatar
    Join Date
    Oct 2002
    Location
    Rotterdam, the Netherlands
    Posts
    871
    Is it just me or does JavaScript only support variant variables...?

    Or is this a lame joke and is this 'one of those days'
    Author for Visual Basic Web Magazine

    My articles on the Web Browser Control:
    Using the Web Browser Control & Using the DHTML Document Object Model

    The examples referenced in the articles can be found here:

  3. #3

    Thread Starter
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    I think both JavaScript and VBScript support only variants...

  4. #4
    Frenzied Member Acidic's Avatar
    Join Date
    Sep 2003
    Location
    UK
    Posts
    1,090
    should .text not be .value??

    also, you can define variables in JS (not sure about VBscript)

    bool = new Boolean
    ar = new Array()
    etc.

    Yeah, it is handy though.
    Have I helped you? Please Rate my posts.

  5. #5
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106
    You can define variables in vbScript, and you can even give them types, they are just ignored.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width