Click to See Complete Forum and Search --> : Unterminated string constant if I hit ENTER key at end


ttmtech
09-29-2003, 11:29 AM
Hi All

<textarea name="notes" OnKeyPress="ChekSizeOfNotes()" cols=52 maxlength=1000 rows=5 > </textarea>


JavaScript:

{...


var str= str+"&solder_type="+'<tmpl_var prnsolder_type>'+"&finish_type="+'<tmpl_var prnfinish_type>'+"&impedence_tolerance="+'<tmpl_var prnimpedence_tolerance>'+"&test_type="+'<tmpl_var prntest_type>'+"&notes="+'<tmpl_var notes>';

.......

}

above is reload by perl script.

When I entered few lines and if I hit ENTER KEY at end and press save button then it pass to JavaScript ,it gives Unterminated string constant error.

If anybody can help me how to take care of this error. Thanks in advance.

skriptor
09-30-2003, 01:02 AM
Hi,
you mentioned you are using perl to create the answer.
Check the perl function chomp, maybe this could solve your problem.
Another point, what happens if your input contains ' ?
Good luck, skriptor.