|
-
Sep 19th, 2002, 02:19 PM
#1
Thread Starter
Frenzied Member
(JavaScript) Syntax error in window.open caused by querystring.
I am using a javascript function to get the values of alot of input fields and escaping them so I can pass them to a window.open function. I am receiving an error when the fields have certain data but not sure what. Here is an example of the data that is causing an error:
reservationReservationID=CMFBMF&reservationHotelName=Demonstration%20Hotel&reservationDateCreated=9/19/2002%201%3A35%3A42%20PM&reservationTitle=Mr&reservationFirstName=Mickey&reservationLastName=Mouse&re servationAddress1=123%20main%20street&reservationAddress2=apt%20300&reservationAddress3=address%20li ne%203&reservationAddress4=address%20line%204&reservationCity=Denver&reservationState=CO&reservation Postal=80206&reservationCountry=US& [email protected]&reservationTelephone=303%20595-2500&reservationFacsimile=303-595-1234&reservationCardType=VI&reservationCardNumber=4444333322221111&reservationExpiry=0905&reservatio nArrivalDate=9/18/2003&reservationDepartureDate=9/23/2003&reservationnumberofnights=&reservationNumberOfAdults=2&reservationNumberOfChildren=1&reservatio nRoomAndRateDate1=9/18/2003&reservationRoomAndRateDescript1=300&reservationRoomAndRateGiven1=King%20Non%20-%20%60smoking%60%20room-type%20in%20the%20name%20field.%28%20Rack%20%29&reservationRoomAndRateDate2=9/22/2003&reservationRoomAndRateDescript2=300&reservationRoomAndRateGiven2=King%20Non%20-%20%60smoking%60%20room-type%20in%20the%20name%20field.%28%20Rack%20%29&reservationRoomAndRateDate3=9/19/2003&reservationRoomAndRateDescript3=375&reservationRoomAndRateGiven3=King%20Non%20-%20%60smoking%60%20room-type%20in%20the%20name%20field.%28%20Rack%20%29&reservationRoomAndRateDate4=9/20/2003&reservationRoomAndRateDescript4=375&reservationRoomAndRateGiven4=King%20Non%20-%20%60smoking%60%20room-type%20in%20the%20name%20field.%28%20Rack%20%29&reservationRoomAndRateDate5=9/21/2003&reservationRoomAndRateDescript5=300&reservationRoomAndRateGiven5=King%20Non%20-%20%60smoking%60%20room-type%20in%20the%20name%20field.%28%20Rack%20%29&reservationAgentIatan=&reservationAgencyName=&reserv ationTAAddress1=&reservationTAAddress2=&reservationTACity=&reservationTAState=&reservationTAZip=&res ervationTACountry=&reservationTATelephone=&reservationTAFacsimile=&reservationCanx=&reservationOther HotelSvcMemo=&reservationomit=on&reservationCurrentRecordNumber=1
Thanks in advance,
Michael
I'm off to GalahTech, hope to see you there.
If you don't like the rules they make, refuse to play their game. -- Steve Ignorant.
-
Sep 19th, 2002, 02:30 PM
#2
Thread Starter
Frenzied Member
maybe it has to do with the max lenght of the querystring? I could not find out what it is but I do know there is a limit.
stuck here.
Michael
I'm off to GalahTech, hope to see you there.
If you don't like the rules they make, refuse to play their game. -- Steve Ignorant.
-
Sep 20th, 2002, 03:47 AM
#3
Fanatic Member
Take a look here for info on the querystring.
http://www.aspfaq.com/show.asp?id=2222
-
Sep 20th, 2002, 08:55 AM
#4
Thread Starter
Frenzied Member
It's an app where I can tell my users "IE Only" but it looks like IE is actualy the lowest in the amount of chars in the string. Either way, in this case I am within that #. As for being URLEncoded, I have a function that does that and as far as I can tell it is doing its job correctly.
hmmm... head scratcher.
Michael
I'm off to GalahTech, hope to see you there.
If you don't like the rules they make, refuse to play their game. -- Steve Ignorant.
-
Sep 20th, 2002, 10:47 AM
#5
Thread Starter
Frenzied Member
I've narrowed it down to this part
&reservationRoomAndRateDescript1=300&reservationRoomAndRateGiven5=King%20Non%20-%20%60smoking%60%20room-type%20in%20the%20name%20field.%28%20Rack%20%29
&reservationRoomAndRateDescript2=300&reservationRoomAndRateGiven5=King%20Non%20-%20%60smoking%60%20room-type%20in%20the%20name%20field.%28%20Rack%20%29
&reservationRoomAndRateDescript3=300&reservationRoomAndRateGiven5=King%20Non%20-%20%60smoking%60%20room-type%20in%20the%20name%20field.%28%20Rack%20%29
&reservationRoomAndRateDescript4=300&reservationRoomAndRateGiven5=King%20Non%20-%20%60smoking%60%20room-type%20in%20the%20name%20field.%28%20Rack%20%29
&reservationRoomAndRateDescript5=300&reservationRoomAndRateGiven5=King%20Non%20-%20%60smoking%60%20room-type%20in%20the%20name%20field.%28%20Rack%20%29
but not sure what part yet
michael
I'm off to GalahTech, hope to see you there.
If you don't like the rules they make, refuse to play their game. -- Steve Ignorant.
-
Sep 20th, 2002, 11:12 AM
#6
Thread Starter
Frenzied Member
the problem was the "%60smoking%60" which is "`smoking`" Those wierd ticmarks buggered up the system so I'll have to figure a way to prevent it in the future.
Thanks
Michael
I'm off to GalahTech, hope to see you there.
If you don't like the rules they make, refuse to play their game. -- Steve Ignorant.
-
Sep 20th, 2002, 11:26 AM
#7
Thread Starter
Frenzied Member
I tried to replace them with regular tic marks " ' " but get the same error. I think it has something to do w/the URLEncoding.
any ideas?
Michael
I'm off to GalahTech, hope to see you there.
If you don't like the rules they make, refuse to play their game. -- Steve Ignorant.
-
Sep 21st, 2002, 09:33 PM
#8
Junior Member
I already do something like this, but in reverse way.
I do something like this: the Submit button loads a "blank.htm" file, then the page with the data uses the object returned by the "window.open" to fill the new window with the data needed.
See a little example:
-------------------------------- RETURN PAGE ----------------------------
<HTML><BODY></BODY></HTML>
-------------------------------- FORM PAGE -------------------------------
<HTML><HEAD><SCRIPT language="JavaScript">
function ShowReturn() {
var w=window.open("blank.htm");
w.document.write("<P>Your name is: " + document.myForm.LastName + ", " + document.myForm.FirstName);
w.document.write("<P>You have <B>" + document.myForm.Age + "</B> years old. ");
--></SCRIPT>
</HEAD><BODY>
<FORM name="myform">
<P>Type your first name: <INPUT TYPE="text" SIZE="15" MAXLEGHT="20" NAME="FirstName"></P>
<P>Type your last name: <INPUT TYPE="text" SIZE="15" MAXLEGHT="20" NAME="LastName"></P>
<P>Type your age: <INPUT TYPE="text" SIZE="15" MAXLEGHT="20" NAME="Age"></P>
<P><INPUT TYPE="Submit" VALUE="Send" onClick:="ShowReturn();"></FORM></BODY></HTML>
I hope it can be usefull to you!
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
|