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 sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Syntax for javascript function for button Action attribute 2

Status
Not open for further replies.

clanm

Programmer
Dec 26, 2005
237
US
I can't get the syntax correct:

if (!navigator.javaEnabled())
{
window.location = "javanotenabled.asp";
} else {
window.location = "MainMenu.asp?WPID="+ <%=session("sessionWPID")%>+"&DB="+ <%=session("sessionDB")%> +"&PC="+ <%=session("sessionPC")%> +"&CA=" + <%=session("sessionCA")%> +"&WPN="+ <%=session("sessionWPN")%>";


Any suggestions?
 
+ is concat in javascript

the problem looks to be you are contactinating when you don't need to

ASP is interpruted prior to the client script so all you need to do is
Code:
"MainMenu.asp?WPID=<%=session("sessionWPID")%>&DB=

etc


General FAQ faq333-2924
5 steps to asking a question faq333-3811
 
Thanks to both of you, DotNetGnat and onpnt!

I ended up using a hyperlink and finally got the syntax of (which is pretty much the same thing you'd recommended):

<a href="MainMenu.asp?WPID=<%=session("sessionWPID")%>&DB=<%=session("sessionDB")%>&PC=<%=session("sessionPC")%>&CA=<%=session("sessionCA")%>&WPN=<%=session("sessionWPN")%>">Main Menu</a>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top