 |
|
| Computers Forum Index » Computer - Databases - Filemaker » change text by validation... |
|
Page 1 of 1 |
|
| Author |
Message |
| Bill Steele... |
Posted: Tue Oct 06, 2009 11:42 pm |
|
|
|
Guest
|
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? |
|
|
| Back to top |
|
|
|
| Your Name... |
Posted: Wed Oct 07, 2009 12:00 am |
|
|
|
Guest
|
"Bill Steele" <ws21 at (no spam) cornell.edu> wrote in message
news:ws21-9AB65B.15425406102009 at (no spam) newsstand.cit.cornell.edu...
Quote: 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 ) |
|
|
| Back to top |
|
|
|
| Bill Steele... |
Posted: Wed Oct 07, 2009 10:47 pm |
|
|
|
Guest
|
In article <hag7il$35o$1 at (no spam) lust.ihug.co.nz>,
"Your Name" <your.name at (no spam) isp.com> wrote:
Quote: "Bill Steele" <ws21 at (no spam) cornell.edu> wrote in message
news:ws21-9AB65B.15425406102009 at (no spam) newsstand.cit.cornell.edu...
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)
That should work. Thanks.
Quote:
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.
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. |
|
|
| Back to top |
|
|
|
| Ursus... |
Posted: Wed Oct 07, 2009 10:55 pm |
|
|
|
Guest
|
some signs have to be escaped before using them in a litteral string
"\"" results in one "
"\\" results in \
complete list is: at (no spam) , *, #, ?, !, =, <, >, "
Samething goes for searching, replacing etc. These signs have to be escape
with a \
--
Keep well / Hou je goed
Ursus
"Bill Steele" <ws21 at (no spam) cornell.edu> schreef in bericht
news:ws21-9AB65B.15425406102009 at (no spam) newsstand.cit.cornell.edu...
Quote: 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? |
|
|
| Back to top |
|
|
|
|
|
All times are GMT
The time now is Sat Nov 28, 2009 1:00 am
|
|