Removing certain chracters from a string like 

Results 1 to 3 of 3

Thread: Removing certain chracters from a string like 

  1. #1
    Join Date
    Dec 1969

    Default Removing certain chracters from a string like 

    I have created a website used to register people attending a conference, the whole things works really well, except for one slight problem that I have just encountered.<BR><BR>I have a text area that people fill in if they have any special requirements, if somebody types &#039; at any point in the text area the form will not work, it causes problems. So I would like to remove the symbol, the only way I know is to use a long winded method of splitting the string where the symbol is, then piecing it back together, unfortunately I have no idea where to symbol will be it may not appear at all.<BR><BR>Any ideas?? any help would be much appreciated.

  2. #2
    Join Date
    Dec 1969

    Default Removing is

    going to cause you great problems. Let me show you<BR><BR>It&#039;s not a good idea! Havn&#039;t you realise<BR><BR>will become<BR><BR>Its not a good idea! Havnt you realise<BR><BR>look in the FAQ&#039;s to find out how to do it properly<BR>

  3. #3
    Join Date
    Dec 1969

    Default replace?

    Have you tried to simply replace it? I assume you&#039;re posting that form to another page, which inserts it into your database? on the 2nd page you could use<BR>replace(myVar, "&#039;","&#039;&#039;")<BR>that would escape it and you shouldn&#039;t have a problem in your database with it. I&#039;m not sure exactly what you&#039;re doing with the code though, so that may not work for you.<BR><BR>A more client-side javascript approach would be something like<BR>while("&#039;") &#062; 0)<BR> myString = myString.replace("&#039;","");<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts