|
-
Aug 18th, 2012, 01:58 PM
#1
Thread Starter
Fanatic Member
Positive I have a syntax error - onChange redirect to URL
So,
I've got a selection box on my form and when I use the follow onChange code, it works as expected
Code:
<select name = "LocSelect" onChange='location.href="editfilltable.asp?Location="+this.form.LocSelect.options[this.form.LocSelect.selectedIndex].value;'>
The problem I have is that I also need to embed a static "un=" and then an ASP variable strUN to the URL.
So, for example if the original code was straight html the URL would be:
editfilltable.asp?Location=LOCATION1
But I need it/want it to be:
If strUN = testuser
editfilltable.asp?un=testuser&Location=LOCATION1
If strUN = anotheruser
editfilltable.asp?un=anotheruser&Location=LOCATION2
Does this make sense?
I can't seem to get my code to work properly on my classic ASP page, by altering the original working code.
-
Aug 19th, 2012, 08:03 AM
#2
Re: Positive I have a syntax error - onChange redirect to URL
To embed a variable use this syntax <%= your variable %> so in your case it would be
editfilltable.asp?un=<%=strUN%>&Location=LOCATION1
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|