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)
 stupid question....
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

redbrad0
Advanced Member

USA
3725 Posts

Posted - 07 June 2001 :  08:46:16  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
ok i have a text field and i want it to display data with quotes in it that comes from a db, whats the best way to do this?


<%
strSize = SQLdecode(rs("CF_Size"))
%>
<input type="text" name="strSize" value="<%=strSize%>" size="25">


Brad

paco
Junior Member

Spain
187 Posts

Posted - 07 June 2001 :  09:14:39  Show Profile
I think you already have it right.

Go to Top of Page

redbrad0
Advanced Member

USA
3725 Posts

Posted - 07 June 2001 :  09:30:10  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
strSize = 29 7/16" x 29"

so therefor when it outputs the data for a text box it shows up like this....

<input type="text" name="strSize" value="29 7/16" x 29"" size="25">

whcih means all i can see in the text box is 29 7/16

Brad
Go to Top of Page

big9erfan
Average Member

540 Posts

Posted - 07 June 2001 :  09:33:38  Show Profile
I think you have to make sure that the string has "" double quotes instead of a single quote " to have it show up properly.



http://www.ugfl.net/forums
Go to Top of Page

paco
Junior Member

Spain
187 Posts

Posted - 07 June 2001 :  10:15:04  Show Profile
You could take out the quotes with replace and put some text like "inches", "in inches" ... after the text field.

You might also want to try replacing double quotes (") with two simple quotes (''). Sometimes it's difficult to know if you have a double quote or two singles.

Go to Top of Page

tilttek
Junior Member

Canada
333 Posts

Posted - 07 June 2001 :  12:08:01  Show Profile  Visit tilttek's Homepage
Change it for:

<%
strSize = SQLdecode(rs("CF_Size"))
%>
<input type="text" name="strSize" value='%=strSize%>'size="25">



Philippe Gamache
http://www.tilttek.com
http://www.lapageamelkor.com
Go to Top of Page

redbrad0
Advanced Member

USA
3725 Posts

Posted - 07 June 2001 :  13:58:57  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
but what if they put in 6' x 23"

quote:

Change it for:

<%
strSize = SQLdecode(rs("CF_Size"))
%>
<input type="text" name="strSize" value='%=strSize%>'size="25">



Philippe Gamache
http://www.tilttek.com
http://www.lapageamelkor.com



Brad
Go to Top of Page

tilttek
Junior Member

Canada
333 Posts

Posted - 07 June 2001 :  14:04:10  Show Profile  Visit tilttek's Homepage
quote:

but what if they put in 6' x 23"



Hum, good question, I don't think there is a real way to do this except:

<textarea cols="25" name="strSize" rows="1" wrap="none"><%=strSize%></textarea>



Philippe Gamache
http://www.tilttek.com
http://www.lapageamelkor.com
Go to Top of Page

cevans
Junior Member

Canada
101 Posts

Posted - 07 June 2001 :  15:31:31  Show Profile  Send cevans an ICQ Message
Just replace any quotes in the string with the quote entity (& quot; with the space removed). This will cause the quotes inside the string to be treated as literals, and thus placed in the textbox, instead of having them treated as the end of your quoted text. Note that you don't have to do anything special about single quotes ('). Since your value attribute is enclosed in double quotes, the single quote character is already treated as a literal.

<%
strSize = Replace(SQLdecode(rs("CF_Size")),"""","& quot;")
%>
<input type="text" name="strSize" value="<%=strSize%>" size="25">


Clark


Edited by - cevans on 07 June 2001 15:38:00
Go to Top of Page

redbrad0
Advanced Member

USA
3725 Posts

Posted - 07 June 2001 :  21:21:58  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
thats what i was thinking, thanks for your input

Brad
Go to Top of Page

Doug G
Support Moderator

USA
6493 Posts

Posted - 07 June 2001 :  22:16:19  Show Profile
Server.HTMLEncode(strSize)

======
Doug G
======
Go to Top of Page

tilttek
Junior Member

Canada
333 Posts

Posted - 08 June 2001 :  09:52:52  Show Profile  Visit tilttek's Homepage
quote:

thats what i was thinking, thanks for your input



Will it work in the Input text?


Philippe Gamache
http://www.tilttek.com
http://www.lapageamelkor.com
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.37 seconds. Powered By: Snitz Forums 2000 Version 3.4.07