ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingASP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old November 17th, 2009, 02:29 PM
jonyBravo jonyBravo is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2007
Posts: 165 jonyBravo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 16 h 35 m 23 sec
Reputation Power: 3
VBScript - General - Question - Quotation

Hi there

On the company in house website application I've a text field where users can add comments.
The problem is some users when about sizes put a number following quotation (ex: 75") and when the comments are displayed using ie it changes all the site layout.
I've tried to uses a replace (ex: replace(variable, """, "''") ) but it didn't work. Is there any solution for this please?

Thanks
__________________
If this help you please show your gratitude by adding reputation points.

Thanks

JonyBravo

Reply With Quote
  #2  
Old November 17th, 2009, 03:23 PM
bigmike1212's Avatar
bigmike1212 bigmike1212 is offline
IsEmpty(BigMikesHead)
ASP Free Novice (500 - 999 posts)
 
Join Date: Jan 2009
Location: In the House of Pain
Posts: 834 bigmike1212 User rank is Major (30000 - 40000 Reputation Level)bigmike1212 User rank is Major (30000 - 40000 Reputation Level)bigmike1212 User rank is Major (30000 - 40000 Reputation Level)bigmike1212 User rank is Major (30000 - 40000 Reputation Level)bigmike1212 User rank is Major (30000 - 40000 Reputation Level)bigmike1212 User rank is Major (30000 - 40000 Reputation Level)bigmike1212 User rank is Major (30000 - 40000 Reputation Level)bigmike1212 User rank is Major (30000 - 40000 Reputation Level)bigmike1212 User rank is Major (30000 - 40000 Reputation Level)bigmike1212 User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 1 Week 1 Day 11 h 5 m 11 sec
Reputation Power: 320
You might try

response.write (Server.HtmlEncode(variable))

Just a guess.
Comments on this post
keep_it_simple agrees!
__________________
Fremen United! Folding@Home team ID 169647. If you aren't on a team, join this one and we'll rule the world!

Reply With Quote
  #3  
Old November 17th, 2009, 03:27 PM
Krandor Krandor is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2008
Posts: 207 Krandor User rank is First Lieutenant (10000 - 20000 Reputation Level)Krandor User rank is First Lieutenant (10000 - 20000 Reputation Level)Krandor User rank is First Lieutenant (10000 - 20000 Reputation Level)Krandor User rank is First Lieutenant (10000 - 20000 Reputation Level)Krandor User rank is First Lieutenant (10000 - 20000 Reputation Level)Krandor User rank is First Lieutenant (10000 - 20000 Reputation Level)Krandor User rank is First Lieutenant (10000 - 20000 Reputation Level)Krandor User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 2 Days 8 h 23 sec
Reputation Power: 102
Quote:
Originally Posted by jonyBravo
Hi there

On the company in house website application I've a text field where users can add comments.
The problem is some users when about sizes put a number following quotation (ex: 75") and when the comments are displayed using ie it changes all the site layout.
I've tried to uses a replace (ex: replace(variable, """, "''") ) but it didn't work. Is there any solution for this please?

Thanks

Instead of:
Code:
variable = replace(variable, """, "''")

Try this:
Code:
variable = replace(variable, CHR(34), "''")

Keep in mind that you may have trouble if you are going to store your data in a database. Many databases have trouble with single quotes (').

Reply With Quote
  #4  
Old November 17th, 2009, 11:54 PM
keep_it_simple's Avatar
keep_it_simple keep_it_simple is offline
KIS
ASP Free Intermediate (1500 - 1999 posts)
 
Join Date: Jul 2007
Location: USA
Posts: 1,635 keep_it_simple User rank is General (90000 - 100000 Reputation Level)keep_it_simple User rank is General (90000 - 100000 Reputation Level)keep_it_simple User rank is General (90000 - 100000 Reputation Level)keep_it_simple User rank is General (90000 - 100000 Reputation Level)keep_it_simple User rank is General (90000 - 100000 Reputation Level)keep_it_simple User rank is General (90000 - 100000 Reputation Level)keep_it_simple User rank is General (90000 - 100000 Reputation Level)keep_it_simple User rank is General (90000 - 100000 Reputation Level)keep_it_simple User rank is General (90000 - 100000 Reputation Level)keep_it_simple User rank is General (90000 - 100000 Reputation Level)keep_it_simple User rank is General (90000 - 100000 Reputation Level)keep_it_simple User rank is General (90000 - 100000 Reputation Level)keep_it_simple User rank is General (90000 - 100000 Reputation Level)keep_it_simple User rank is General (90000 - 100000 Reputation Level)keep_it_simple User rank is General (90000 - 100000 Reputation Level)keep_it_simple User rank is General (90000 - 100000 Reputation Level) 
Time spent in forums: 3 Weeks 6 Days 14 h 58 m 45 sec
Reputation Power: 984
Send a message via Yahoo to keep_it_simple
since you are displaying then try using mike's suggestion...i believe it will 'display' with the html's 'ampersand quot;' versus "...

i do not think you will need to 'replace' anything..let us know
__________________
Please give respect to those that helped solve an issue by clicking on the reputation icon

Last edited by keep_it_simple : November 17th, 2009 at 11:57 PM.

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingASP Development > VBScript - General - Question - Quotation


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump





 Free IT White Papers!
 
Create the Optimal Architecture for your Critical Applications
Warburton's the largest independently owned bakery in the UK faced a number of difficult challenges in providing the most robust yet efficient IT infrastructure for their organization's success. IBM's services combined with their xSeries servers created the perfect platform for their SAP environment with sufficient flexibility, and did so in very time effective fashion.

 
Five Best Practices for Deploying a Successful Service-Oriented Architecture
This white paper describes the benefits you can expect with SOA, and how IBM can help take your business there.

 
Gartner Magic Quadrant for Application Delivery Controllers
Gartner summarizes its view on Application Delivery Controllers, evaluates strengths and weaknesses of solutions, and provides Magic Quadrant reporting for a quick comparison across all vendors. Learn from Gartner how you can benefit from an all-in-one device like Citrix NetScaler that delivers the highest levels of availability, performance and security.

 
Knowledge is Power
What you don't know can hurt you, and is likely costing you money and increasing your security risks during an era of scarce resources. This white paper proposes six key strategies that enterprise security managers can use to improve their network defense posture.

 
Rationalizing the Multi-Tool Environment
The rationalized multi-tool approach is flexible, scalable and cost effective. It provides the necessary input to the IT service management business processes. It preserves prior investments in monitoring tools, empowers technologists to select the best tools with which to do their jobs, and enhances effective response to incidents.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2010 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek