Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can anyone help with vbscript?

Status
Not open for further replies.

dtran

Programmer
Jun 25, 2001
29
US
I have an error that I can't seem to figure out.
Code: <input type=&quot;submit&quot; onClick=&quot;<%=updDept(%>this.form.TransferList<%=)%>&quot; value=&quot;Update&quot; id=&quot;Update&quot; name=&quot;Update&quot;>
Error: expected ')'
Response.Write(updDept()

Any help would be appreciated.

Thanks
 
everything betwee <% and %> is considered ASP source.
so you have 2 snippets:

<%=updDept(%>
<%=)%>

asp is complaining about the first piece:
it is expecting updDept()








br
Gerard
 
the thing is that I am using server-side vbscript with client side javascript. If I don't include <% %> it won't recgonize it, I think. I am kinda new to vbscript and jscript.

Please be more detailed.

Thanks
 
I think your logic is flawed.

Remember this:
Client side code is not compiled until after the server side code has completed. And the server does not know what 'this.form.TransferList' is -- and so it can't use it as a valid identifier to reference your recordset.

So basically, you are asking the server to be aware of something client side -- i.e. trying to reference a server side element based on a client side value. It just won't work.

The only way to get a client side variable back to server side is to reload the page, while posting some sort of form data -- and then reading it back into a server side variable.

You can use server side code to render your client side code, but not the other way around. Check out the FAQ area of this forum for a better explanation -- faq329-603 -- it's sort of confusing until you get it down.

I hope this makes some sense. I'm sort of confusing myself sitting here trying to explain it --

:)
penny.gif
penny.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top