We help IT Professionals succeed at work.

href with vbscript sub

Iron01
Iron01 asked
on
1,070 Views
Last Modified: 2008-02-01
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>

Comment
Watch Question

Top Expert 2005

Commented:
Try using this:

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

Author

Commented:
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.
Top Expert 2005
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Top Expert 2005

Commented:
Just investifating something.  Does this work?

onclick="setPageToPanels '/xb1.jpg', '/xb2.jpg', '/xb3.jpg', '/xb4.jpg', 'exterior back'"
Top Expert 2005

Commented:
or this?

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

Author

Commented:
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
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.