Web Analytics Made Easy -
StatCounter TextBox - CodingForum

Announcement

Collapse
No announcement yet.

TextBox

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • TextBox

    Hi
    When user enters single quote(') in text box with text i need to replace with double quotes('') wherever they enter single quotes before submitting form b'coz i am using stored procedures when users enter single quote i am getting eroor like text is terminated(sql Error). i would appreciate any help
    thanks
    krishna

  • #2
    I think this should do it......

    Code:
    function fixValue(unFormat) { 
      format = unFormat.replace(/'/gi,'"');
      return format;
    }
    call it by

    newValue = fixValue(document.FormName.ElementName.value);
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]

    Comment


    • #3
      You should change it on serverside to be safe.

      Which serverside language are you using?
      /Daniel

      Comment


      • #4
        asp

        Hi danne
        i am using vb.net my application is asp.net.if you know can you tell me how to do in vb.net.i am having many textboxes in application .i think fucntion is better.
        thanks

        Comment

        Working...
        X