neverrealm
asked on
String with carriage returns causes problems
I am trying to display a String by default into a text area using a JSP directive and it works unless there is a carriage return contained in the String that is returned.
What I am looking for is what character will represent the carriage return to do a substring and break it up into multiple javascript assignments.
For instance:
Now there is:
document.getElementById('c overRow2') .innerHTML = "<textarea cols='40' rows='10' name='coverPageContent' id='coverPageContent' onKeyUp='setScreenState(tr ue); wrap'><%=faxCoverBLOB.getC ompressedB lobString( ) %></textarea>";
I think I would need to go with
javascriptString += substring(faxCoverBLOB.get Compressed BlobString (), 0, indexOf('character')) or something like that, but I don't know which character I should search for.
What I am looking for is what character will represent the carriage return to do a substring and break it up into multiple javascript assignments.
For instance:
Now there is:
document.getElementById('c
I think I would need to go with
javascriptString += substring(faxCoverBLOB.get
actually
faxCoverBLOB.getCompressed BlobString ().relpace All("\n"," \\n").relp aceAll("\" ","\\"");
faxCoverBLOB.getCompressed
ASKER
That's a great idea, but it didn't work. Also my IDE won't compile the page with the replaceAll("\"", "\\"") portion. I still get an unterminated string constant with this.
ASKER
Well, I had to bite the bullet and include the textarea in the main source of the html. Does anyone have a good way of handling an unchecked checkbox submit?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
if you have a boolean value for your checkbox:-
<% boolean chkBoxVal=(request.getPara meter("chk BoxParam") !=null)?tr ue:false;% >
<% boolean chkBoxVal=(request.getPara
ASKER
Actually, I figured it out already, but gave you the answer. I have a javascript method that actually does the submitting and I can pass additional request paramaters to it and have used that.
Thanks anyhow. The replaceAll function may come in handy later.
Thanks anyhow. The replaceAll function may come in handy later.
faxCoverBLOB.getCompressed