Using (') and (") in a form

Results 1 to 3 of 3

Thread: Using (') and (") in a form

  1. #1
    Join Date
    Dec 1969

    Default Using (') and (") in a form

    Why doesn;t my form process when it contains either a " or &#039; <BR><BR>The error is when the information is being submitted to a database.<BR>and how can i fix?<BR><BR>Help!<BR>Dizzy

  2. #2
    Join Date
    Dec 1969

    Default RE: Using (') and (

    if u use &#039; and " it will terminate the query so write a function to remove the &#039;and " before entering the values to the database

  3. #3
    Branton Boehm Guest

    Default double them up!

    Instead of just removing them, try writing a function to double them up. That is, turn all &#039; into &#039;&#039; and all " into "". I know this works with the single quote, and I suspect it does with the double quote, too. When you retrive the data back out from the database, it will only contain one of the two &#039; or ".<BR><BR>The following code will do it in JScript I&#039;m sure there is something similar in VBScript.<BR><BR>&nbsp;&nbsp;function convertString(s)&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp ;return s.replace(/&#039;/g, "&#039;&#039;");<BR>&nbsp;&nbsp;}

Posting Permissions

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