Forum Moderators: open
Here is the code:
<form name="f1" action="request.asp" method=POST>
<script language="JavaScript"> <!--
var editor1 = new EDITOR();
editor1.create("This is where the text goes");
//--> </script>
How can i get it to show <%=objrs("textArea")%> in place of
"This is where the text goes"
?
For the .create method's parameter, perhaps you should not be replacing the quotes. That is:
editor1.create("<%=objrs("textArea")%>");
This might also pose a problem if there are quotes and/or apostrophes in the field data.
If you look at the page's source code as it had arrived in the browser, do you see the actual argument, or simply the <%=text%>?
it also does not like quotes that are in between the quotes so i have tried changing the outside quotes to ' and this works.
var editor1 = new EDITOR();
editor1.create('bla bla bla bla');
when inputting either db or own text if there is a line break in the source code then that when it fails like below:
var editor1 = new EDITOR();
editor1.create("bla bla bla
bla");
i have just gone back into the db and made the code all one line and it now works, so at the point of entry into db how can i make all code one line?
Then when the string gets stuffed into the javascript, it will be pre-cleaned of disruptive characters.
This also means that this will work with any data ASP pulls from a database, anywhere. You can't *always* be able to clean data before it goes into a database (as much as I have tried).