Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 String within code?
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

instantnet11
New Member

USA
69 Posts

Posted - 06 October 2003 :  16:35:39  Show Profile  Visit instantnet11's Homepage  Send instantnet11 an AOL message  Send instantnet11 an ICQ Message  Send instantnet11 a Yahoo! Message
Curretly I have a test file which is brings up information form the DB from the following just fine.

<input type="text" name="strName" size="50" value="<%=strProdName%>">

And this also works fine..

<%
Set oFCKeditor = New FCKeditor
oFCKeditor.Value = ""defaultvalue
oFCKeditor.CreateFCKeditor "strDesc", "100%", 250
%>

Howeve when I try to use this...

<%
Set oFCKeditor = New FCKeditor
oFCKeditor.Value = "<%=strProdDesc%>"
oFCKeditor.CreateFCKeditor "strDesc", "100%", 250
%>

I get the following error...

Microsoft VBScript compilation error '800a0409'

Unterminated string constant

/adminEditProductFields.asp, line 132

oFCKeditor.Value = "<%=strProdDesc
----------------------------------^


Anyone have an idea on how i can pull this info up?

Thanks!

Nikkol
Forum Moderator

USA
6907 Posts

Posted - 06 October 2003 :  16:40:49  Show Profile
you cannot have nested asp delimiters like you have. change this:
<%
Set oFCKeditor = New FCKeditor
oFCKeditor.Value = "<%=strProdDesc%>"
oFCKeditor.CreateFCKeditor "strDesc", "100%", 250
%>

To this:
<%
Set oFCKeditor = New FCKeditor
oFCKeditor.Value = strProdDesc
oFCKeditor.CreateFCKeditor "strDesc", "100%", 250
%>[/code

Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~
Go to Top of Page

redbrad0
Advanced Member

USA
3725 Posts

Posted - 06 October 2003 :  17:00:41  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
well dont type in the [/code that nikkol forgot to close :-)

Brad
Oklahoma City Online Entertainment Guide
Oklahoma Event Tickets
Go to Top of Page

instantnet11
New Member

USA
69 Posts

Posted - 06 October 2003 :  17:14:09  Show Profile  Visit instantnet11's Homepage  Send instantnet11 an AOL message  Send instantnet11 an ICQ Message  Send instantnet11 a Yahoo! Message
Through trial an error I was able to figure that out finally. Of course I could have taken a break and come back to the fourm :-)

Now it is saving and correctly storing the HTML info in the DB however when it comes time to pull it back up again

in the db

<P align=center><FONT color=#ff0000 size=5>TRY THIS</FONT></P>

comes up exactly as that in the browser

so I use the html encode function

<%=Server.HTMLEncode( strProdDesc)%>

And it comes up...
<P align=center><FONT color=#ff0000 size=5>TRY THIS</FONT></P>

I looked for a decode function...

Also I need to crrret this before putting it back into the HTML editor or else it will think that you are trying to actually enter "<center></center> instead of just centering your text

Thanks!

Edited by - instantnet11 on 06 October 2003 17:15:21
Go to Top of Page

Nikkol
Forum Moderator

USA
6907 Posts

Posted - 06 October 2003 :  17:19:17  Show Profile
quote:
Originally posted by redbrad0

well dont type in the [/code that nikkol forgot to close :-)

oops

Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~
Go to Top of Page

instantnet11
New Member

USA
69 Posts

Posted - 06 October 2003 :  20:11:13  Show Profile  Visit instantnet11's Homepage  Send instantnet11 an AOL message  Send instantnet11 an ICQ Message  Send instantnet11 a Yahoo! Message
How do I get the right formatting then?

Thanks
Go to Top of Page

Nikkol
Forum Moderator

USA
6907 Posts

Posted - 06 October 2003 :  20:30:59  Show Profile
i'm confused as to what the database is actually storing. Is it storing <p> for instance or &lt;p&gt; ?

Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~
Go to Top of Page

instantnet11
New Member

USA
69 Posts

Posted - 06 October 2003 :  20:52:11  Show Profile  Visit instantnet11's Homepage  Send instantnet11 an AOL message  Send instantnet11 an ICQ Message  Send instantnet11 a Yahoo! Message
db is actually storeing the HTML code <p>

However i cant get it to display correctly...

Thanks!
Go to Top of Page

Nikkol
Forum Moderator

USA
6907 Posts

Posted - 06 October 2003 :  21:01:28  Show Profile
how are you trying to display it? you should just be able to do a response.write(strWhatever)

Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~
Go to Top of Page

instantnet11
New Member

USA
69 Posts

Posted - 06 October 2003 :  21:16:24  Show Profile  Visit instantnet11's Homepage  Send instantnet11 an AOL message  Send instantnet11 an ICQ Message  Send instantnet11 a Yahoo! Message
arg!

This is bein stored in database. GOOD

<OL> <LI> <DIV align=center><FONT face="Comic Sans MS" size=3>THIS IS A TEST</FONT></DIV></LI></OL>

This is what happens when is is retrved using <%=strProdDesc%> BAD
<OL> <LI> <DIV align=center><FONT face="Comic Sans MS" size=3>THIS IS A TEST</FONT></DIV></LI></OL>

This is what happens when the string is returned using <%=Server.HTMLEncode( strProdDesc)%> I think I need a decode function?

<OL> <LI> <DIV align=center><FONT face="Comic Sans MS" size=3>THIS IS A TEST</FONT></DIV></LI></OL>

thanks


Go to Top of Page

Nikkol
Forum Moderator

USA
6907 Posts

Posted - 06 October 2003 :  21:56:11  Show Profile
how are you defining strProdDesc?

Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~
Go to Top of Page

instantnet11
New Member

USA
69 Posts

Posted - 09 October 2003 :  04:01:31  Show Profile  Visit instantnet11's Homepage  Send instantnet11 an AOL message  Send instantnet11 an ICQ Message  Send instantnet11 a Yahoo! Message
You mean how am I calling it? I think I mentioned this in the first post. :-) Thats ok though <%=strProdDesc%> I think we are going in circles though.

Its working correctly. All I need it to do is to change the HTML code to a html output
instead of <center>this text</center>
displays this text

Thank you

Kieran Mullen

-------------

Free Snitz Web Site Hosting With Auto Setup

http://freeforums.instantnetworks.net/

Go to Top of Page

Nikkol
Forum Moderator

USA
6907 Posts

Posted - 09 October 2003 :  08:03:26  Show Profile
glad you fixed it.

strProdDesc is a variable and you never showed us where you had a line like

strProdDesc = something here

that's what i was asking on how you are defining it.

Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~
Go to Top of Page

instantnet11
New Member

USA
69 Posts

Posted - 10 October 2003 :  00:41:43  Show Profile  Visit instantnet11's Homepage  Send instantnet11 an AOL message  Send instantnet11 an ICQ Message  Send instantnet11 a Yahoo! Message
quote:

Its working correctly. All I need it to do is to change the HTML code to a html outputinstead of

<center> this text</center>

displays

this text




Edited by - instantnet11 on 10 October 2003 00:42:08
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.32 seconds. Powered By: Snitz Forums 2000 Version 3.4.07