Hi, > So those two string above contain ' and spcecial characters. > > In the application I need to feed those to a javascript function using > onclick, so I use: > > onclick="remove('<%= card.name %>')" > > Doing it that way, the HTML results in: > > onclick="remove('Validaci')" > onclick="remove('Tom's card')" > > You can see that the first one is ok, but the second on is not because > of the ' in between the m and the s which causes the javascript > to fail. One way to avoiding this is escaping the apostrophe character (') by using a backslash character (\). Please try following code: onclick="remove('<%= card.name.gsub( "'" ){ "\\'" } %>')" -- NOBUOKA Yu