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

Untermininated String Constant Error

Status
Not open for further replies.

SDyke

MIS
Oct 13, 2005
55
US
The following script causes a error I suppose because of the dash. What can I do to prevent the error and process correctly? Note everything works fine when I use a number that does not have a dash.

This is the client side code. The JSF uses EL to determine the dynamic values.

Code:
function populatePaths(){
var dirName = "\\\\gvsvr03\\drawings\\wgen\\pre_pdf\\sourcefiles\\"
		
var fileName1 = "861027-405" + "A" + "1.rtf"
var fileName2 = "861027-405" + "A" + "2.rtf"
var fileName3 = "861027-405" + "A" + "3.rtf"
var fileName4 = "861027-405" + "A" + "4.rtf"
var fileName5 = "861027-405" + "A" + "5.rtf"
		
document.getElementById('form1:text7').value = dirName+fileName1;
document.getElementById('form1:text8').value = dirName+fileName2;
document.getElementById('form1:text9').value = dirName+fileName3;
document.getElementById('form1:text10').value = dirName+fileName4;
document.getElementById('form1:text11').value = dirName+fileName5;
document.getElementById('form1:text12').value = "66057";
		
}
 
Where would I replace the "-" with the "&#45"? Would I need to do it in the class where the number is retrieved in the result set or on the servlet when I assign it to the session attribute? It at the srvlet what is the relace syntax for the following servlet code:

Code:
session.setAttribute("dwgno2", drawingString.getDwgName().trim());
 
Dashes should not cause this.

- Have you tried putting semicolon delimiters after all of your statements?

- What browser(s) does it error in? Under what OS?

- What does the rest of the code on your page look like? Do yu have a URL to an online test harness?

Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
I got the issue resolved. It was carriage returns in a string I was tring to assign to a session attribute then use in an input box. When I stripped out the carriage returns it works great. Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top