views:

37

answers:

1

Hi,

What is the correct way to comma delimit this line, I keep getting javascript errors:

<a href="javascript:doSubmit(<%= pound & rs("AdvertiserID")%>, <%=rs("AdvertiserName")%>)">

Its Friday, what can I say...

The <%=rs("AdvertiserName")%>) can have single quotes in it, such as Dillard's and needs to be delimited, how would I add them? so I would end up with doSubmit(5432, "Dillard's")?

Thanks, R.

A: 

I think you need to swap the positions of your final double quote and close parenthesis:

)" instead of ")

Ray
You are correct, thank you (it is Friday)...The <%=rs("AdvertiserName")%>) is a string and can have single quote marks in it, such as Dillard's and it needs single or double quote marks around it so that it won't fail, any ideas?
flavour404
You can escape the single quotes - call replace like this: <%= rs("AdvertiserName").Replace("'", @"\'") %>
Ray
flavour04 - if my answer resolved your problem, please give me an answer flag
Ray
Ray, it didn't resolve the issue, kept throwing an error message 'doesnt support function' otherwise i would have given the tick. Thanks for trying though.
flavour404
Ray, it wasn't exact but it did point me in the right direction so i am giving it too you ::) Have a good one and a merry xmans...
flavour404
thanx, and a merry one to you as well - did you need to use 'ToString()' or something to make it work?
Ray