change text by validation - 10-06-2009 , 02:42 PM
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.
Re: change text by validation - 10-06-2009 , 03:00 PM
"Bill Steele" <ws21 (AT) cornell (DOT) edu> wrote
unwanted characters, and then use that Field for the web.
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 )
Re: change text by validation - 10-07-2009 , 01:47 PM
In article <hag7il$35o$1 (AT) lust (DOT) ihug.co.nz>,
"Your Name" <your.name (AT) isp (DOT) com> wrote:
It does when you put a whole database on the web, but here we're pulling
text out of various fields and rearranging it. There is a "Get as CSS"
function that generates HTML, but like very other automatic HTML
generator it produces messy code that needs about 40 lines of script to
clean up. For this particular field I can just wrap the text in <p></p>
and it's done.
Re: change text by validation - 10-07-2009 , 01:55 PM
some signs have to be escaped before using them in a litteral string
"\"" results in one "
"\\" results in \
complete list is: @, *, #, ?, !, =, <, >, "
Samething goes for searching, replacing etc. These signs have to be escape
with a \
Keep well / Hou je goed
"Bill Steele" <ws21 (AT) cornell (DOT) edu> schreef in bericht
news:ws21-9AB65B.15425406102009 (AT) newsstand (DOT) cit.cornell.edu...