User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP section within the Web Development category of DaniWeb, a massive community of 423,657 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,165 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP advertiser: Lunarpages ASP Web Hosting
Views: 4178 | Replies: 2
Reply
Join Date: Mar 2005
Posts: 1
Reputation: Forikan is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Forikan Forikan is offline Offline
Newbie Poster

" ' " and post method : use of replace function ?

  #1  
Mar 2nd, 2005
Hello,

My question is about an HTML form using "POST" method.

I'm using a simple HTML form, from which I get back my variables with this code :
sLastName = Request.Form.Item("LastName")
This work correctly.

But when the user fill the blank field with a string containing " ' ", I only get the first part of the field, before the '.
I've tried to use the following code instead :

sLastName = Replace(Request.Form.Item("LastName"),"'","''")

But this doesn't work anymore.

Any ideas on how to get the full field with the " ' " ?

Regards.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Feb 2005
Location: Los Angeles, CA
Posts: 86
Reputation: dexterz is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 2
dexterz dexterz is offline Offline
Junior Poster in Training

Re: " ' " and post method : use of replace function ?

  #2  
Mar 2nd, 2005
Code:

Dim sLastName
sLastName = Request.Form("LastName")
sLastName = Replace(sLastName, "'", "''")
Dexter Zaf
Ex-designz.net
Reply With Quote  
Join Date: Jan 2005
Location: Sheffield, UK
Posts: 294
Reputation: zippee is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 6
zippee's Avatar
zippee zippee is offline Offline
Posting Whiz in Training

Re: " ' " and post method : use of replace function ?

  #3  
Mar 6th, 2005
sLastName = Replace(sLastName, "'", "´")

You will get I'm rather than I"m
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb ASP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the ASP Forum

All times are GMT -4. The time now is 10:56 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC