Results 1 to 8 of 8

Thread: (JavaScript) Syntax error in window.open caused by querystring.

  1. #1

    Thread Starter
    Frenzied Member msimmons's Avatar
    Join Date
    Jul 2001
    Location
    Houston, TX
    Posts
    1,057

    (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.

  2. #2

    Thread Starter
    Frenzied Member msimmons's Avatar
    Join Date
    Jul 2001
    Location
    Houston, TX
    Posts
    1,057
    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.

  3. #3
    Fanatic Member punkpie_uk's Avatar
    Join Date
    Sep 2001
    Location
    UK
    Posts
    645
    Take a look here for info on the querystring.

    http://www.aspfaq.com/show.asp?id=2222
    SPREAD THE WORD!!! Are You Lee McCormick? Because I Am



    Lee M McCormick
    [email protected]

    Lee McCormick.com - Live
    Dynamically Webbed.com - In development but live

  4. #4

    Thread Starter
    Frenzied Member msimmons's Avatar
    Join Date
    Jul 2001
    Location
    Houston, TX
    Posts
    1,057
    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.

  5. #5

    Thread Starter
    Frenzied Member msimmons's Avatar
    Join Date
    Jul 2001
    Location
    Houston, TX
    Posts
    1,057
    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.

  6. #6

    Thread Starter
    Frenzied Member msimmons's Avatar
    Join Date
    Jul 2001
    Location
    Houston, TX
    Posts
    1,057
    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.

  7. #7

    Thread Starter
    Frenzied Member msimmons's Avatar
    Join Date
    Jul 2001
    Location
    Houston, TX
    Posts
    1,057
    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.

  8. #8
    Junior Member
    Join Date
    Aug 2002
    Location
    Brazil
    Posts
    29
    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
  •  



Click Here to Expand Forum to Full Width