Page Error (Can't be Found)

S

SyrOrange

I am trying to send two values to a page, this is very similar to a previous
post that I saw on this newsgroup, not sure if it was resolved or not.
"Results.ASP" exists, I am thinking there is something wrong with my syntax.

onchange="parent.usbWindow.location.href='connector1=<%=cnt1%>&Results.asp?T
ype='+this.value;"

Thank you
 
R

Ray Costanzo [MVP]

You don't have a page name in your .href property. Is that your
intention? .href='PAGE.ASP?connector1=....'

--

Ray at work
Microsoft ASP/ASP.NET MVP
 
S

SyrOrange

Mr. Costanzo,

I am not getting the error, which is good, but it is not sending the value
of Connector1

onchange=parent.usbWindow.location.href='Results.asp?Type='+this.value;
Connector1=' & <%=cnt1%> & ';

The response.write of my SQL statement is
SELECT * FROM Perps where Connector1 = '' and Type = 'Type 1'
Form is using GET method

Results.ASP has
Connector1 = Request.QueryString("cnt1")
 
R

Ray Costanzo [MVP]

Try Request.Querystring("Connector1") after correcting the .href
property. Try this for your .href property.

onchange="parent.usbWindow.location.href='results.asp?connector1=<%=c
nt1%>&type=' + this.value + ';"

--

Ray at work
Microsoft ASP/ASP.NET MVP
 
A

Aaron [SQL Server MVP]

I think it should be:

onchange="parent.usbWindow.location.href='results.asp?connector1=<%=c
nt1%>&type=" + this.value + ";'"

Otherwise, the string literal "this.value" is embedded in there...
 
A

Aaron [SQL Server MVP]

Whoops.

onchange="parent.usbWindow.location.href='results.asp?connector1=<%=c
nt1%>&type=" + this.value + "';"
 
S

SyrOrange

It is giving me runtime error "Expected ;"



Ray Costanzo said:
Try Request.Querystring("Connector1") after correcting the .href
property. Try this for your .href property.

onchange="parent.usbWindow.location.href='results.asp?connector1=<%=c
nt1%>&type=' + this.value + ';"
 
S

SyrOrange

Receiving an "unterminated string constant error" All quotes seem to be
fine to me.
 
L

larrybud2002

SyrOrange said:
I am trying to send two values to a page, this is very similar to a previous
post that I saw on this newsgroup, not sure if it was resolved or not.
"Results.ASP" exists, I am thinking there is something wrong with my syntax.
onchange="parent.usbWindow.location.href='connector1= said:
ype='+this.value;"

The way your URL would be interpreted would be

connector1=xxx&Results.asp?Type=xxx

Obviously that's not a valid URL. If Results.asp is the page you
want to go to, the URL should be
'Results.asp?put your variables here'.
 
R

Ray Costanzo [MVP]

That would result in:

onchange="..href='page.asp"...

I had an extra ' in my post though as well.


HERE:

onchange="location.href='results.asp?connector1=<%=cnt1%>&type=' +
this.value;"

Or in a sample:

<% cnt1 = "xxx" %>
<select
onchange="location.href='results.asp?connector1=<%=cnt1%>&type=' +
this.value;">
<option>kjasd</option>
<option value="kjasdkj">kjasdf</option>
</select>

--

Ray at work
Microsoft ASP/ASP.NET MVP
 
R

Ray Costanzo [MVP]

No, ;" is correct I believe, since it's terminating the javascript
line. The " is just encapsulating all the text that just so happens
to be javascript.

--

Ray at work
Microsoft ASP/ASP.NET MVP
 
A

Aaron [SQL Server MVP]

The semi-colon terminates AFTER the string. You don't say alert("foo;") you
say alert("foo");
also you don't say a = "foo;" you say var a = "foo"; ...

--
http://www.aspfaq.com/
(Reverse address to reply.)
 
R

Ray Costanzo [MVP]

Right, but my string, 'result.asp?...' was delimited by '. The
onchange attribute value is what's delimited by ".

--

Ray at work
Microsoft ASP/ASP.NET MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,135
Latest member
VeronaShap
Top