"Bill Steele" wrote in message
> I have a text field that eventually ends up on the web, so want to be
> sure no one pastes in curly quotes or apostrophes. So I set up a
> validation on leaving the field to substitute straight quotes for curly.
> Works OK. but if there are no curly things in the fierld it gives an
> error message: This field is defined to contain only certain values."
>
> So I wrapped the substitute in an if statement. If the position of the
> quote is not 0, do the substitution. Still gives me that error.
>
> I can do it in FM 10 with a script trigger, but not every user has 10.
>
> Suggestions?
The simplest option is to use a new Calculation Field that replaces all the
unwanted characters, and then use that Field for the web.
i.e.
WebField Calculation, Text Result, Unstored
= Substitute(OriginalField, CurlyQuote, StraightQuote)
As well as curly quotes (depending on what's being entered), you may need to
also replace curly apostrophes, long dashes (em-dash, etc.), "&" characters,
copyright / registered / TM symbols, ...
You could of course replace these things with the correct HTML &codes. I've
never used the web side of FileMaker, but I would have thought it should do
such things automatically.
Helpfull Harry

)