Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. need to allow apostrophe in textbox byusing javascript function

need to allow apostrophe in textbox byusing javascript function

Scheduled Pinned Locked Moved ASP.NET
javascriptregexhelp
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    subbu sk
    wrote on last edited by
    #1

    Hai all, i had one function which does not accept apostrophies for the text box but i need to accept the apostrophe for the textbox can any one help me...i am new to javascript... }else if(c.indexOf(' validate-address ')!=-1&&t.replace(/ /g,'').replace(/[,]/g,'').replace(/[.]/g,'').match(/\W/)){valid=false;

    Thanks Subbu.

    G 1 Reply Last reply
    0
    • S subbu sk

      Hai all, i had one function which does not accept apostrophies for the text box but i need to accept the apostrophe for the textbox can any one help me...i am new to javascript... }else if(c.indexOf(' validate-address ')!=-1&&t.replace(/ /g,'').replace(/[,]/g,'').replace(/[.]/g,'').match(/\W/)){valid=false;

      Thanks Subbu.

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      Just remove the apostrophes from the string before the match. Why do you have to many replace calls when you can do all the replacing in one?

      }else if(c.indexOf(' validate-address ')!=-1&&t.replace(/[ ,.']+/g,'').match(/\W/)){valid=false;

      Despite everything, the person most likely to be fooling you next is yourself.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups