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

spaces in the input variable (IE and Netscape under App servers)

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
hi,

the following code to open a url in a new window:
------------------------------------------------------------
{
..
var accNo = "2456";
var reasonid = "3";
var comments =" this is a test comment";
var url = "FDPW_BO_RejectReason.jsp?type=update&acno="+ accNo +"&reasonid="+reasonid+"&comments="+comments;

window.open(url, "_blank", "scrolllbars=no,height=230,width=650,top=20,left=20");
}
------------------------------------------------------------
is running perfectly fine in inernet explorer 5.0 and netscape navigator 4.73 under weblogic server

i am using another application server called jaguar CTS. It is running fine with IE but giving error 'Bad Request 400' if i use netscape.

if i use var comments ="thisisatestcomment" i.e i remove spaces it works fine in Netscape too under jaguar.

i want to know where is the problem, in netscape or in the appserver and how netscape treats the spaces while posting the data.

regards,
Nishant



 
all need to have to do is :

{
..
var accNo = "2456";
var reasonid = "3";
-----------------> var comments =escape(" this is a test comment");
var url = "FDPW_BO_RejectReason.jsp?type=update&acno="+ accNo
+"&reasonid="+reasonid+"&comments="+comments;

window.open(url, "_blank", "scrolllbars=no,height=230,width=650,top=20,left=20");
}

Indeed, you're not allow to put spaces into a URL (even if it works with ie). The escape method will encode you variable . In this case all spaces will be replace by a '+'.
bye.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top