Link to home
Start Free TrialLog in
Avatar of Iron01
Iron01

asked on

href with vbscript sub

I'm getting the error massage "Expected end of statement".

sub setPageToPanels(Img1, Img2, Img3, Img4, Panel)
      panel=Panel
      document.getElementById("img1st").src=Img1
      document.getElementById("img2nd").src=Img4
      document.getElementById("img3rd").src=Img3
      document.getElementById("img4th").src=Img4
end sub

<a href="#" onclick="setPageToPanels '/xb1.jpg', '/xb2.jpg', '/xb3.jpg', '/xb4.jpg', 'exterior back' return false" target="_parent" id="XB">Back</a>

Avatar of mshogren
mshogren

Try using this:

onclick="setPageToPanels('/xb1.jpg', '/xb2.jpg', '/xb3.jpg', '/xb4.jpg', 'exterior back'); return false"
Avatar of Iron01

ASKER

If I try that line of code I get the message "Cannot use parentheses when calling a sub".
If I remove the parentheses but leave the ";" I get the original error message.
ASKER CERTIFIED SOLUTION
Avatar of mshogren
mshogren

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Just investifating something.  Does this work?

onclick="setPageToPanels '/xb1.jpg', '/xb2.jpg', '/xb3.jpg', '/xb4.jpg', 'exterior back'"
or this?

onclick="Call setPageToPanels('/xb1.jpg', '/xb2.jpg', '/xb3.jpg', '/xb4.jpg', 'exterior back'); return false"
Avatar of Iron01

ASKER

I tried omitting the "return false" but it moves forward. I also tried the call and that didn't work but I rewrote the sub to a javascript function and that seems to work. Thanks