Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Oct 2002
    Location
    Lakewood, New Jersey, USA
    Posts
    187
    Thanks
    0
    Thanked 0 Times in 0 Posts

    calling multiple functions in VBScript

    I would like to call multiple vbscript functions in an onblur event on an input field. Following is the html that I tried:

    <input type="text" onblur="CalcTotIncome();CalculateHousingRatio();Ca lculateDebtRatio()" name="income" size="20" value="<%=formatMoney(rs("income"))%>" tabindex="11">

    I've tried it with and without a semi-colon at the end of the function calls. It doesn' work either way. I get an error - "end of statement expected".

    If anyone can help me with the correct syntax, I'd really appreciate it.

  2. #2
    2 Star Lounger
    Join Date
    Oct 2002
    Location
    Lakewood, New Jersey, USA
    Posts
    187
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: calling multiple functions in VBScript

    found the answer:

    the function calls need to be separated by colons.

  3. #3
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: calling multiple functions in VBScript

    (I realize you've already discovered the answer here, but for the benefit of those who may want more information...)

    The Colon in Visual Basic (and VBScript and VBA) indicates a command break, much like the Semi colon in C-based languages (Java, C++, C#, JavaScript).

    This allows you to place multiple lines of commands on a single line for space preservation purposes.

Posting Permissions

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