Welcome to dbFreaks.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

change text by validation

 
   Database Help (Home) -> FileMaker RSS
Next:  Linked Server problem  
Author Message
Bill Steele

External


Since: Mar 13, 2008
Posts: 14



(Msg. 1) Posted: Tue Oct 06, 2009 3:42 pm
Post subject: change text by validation
Archived from groups: comp>databases>filemaker (more info?)

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?

 >> Stay informed about: change text by validation 
Back to top
Login to vote
Your Name

External


Since: Nov 04, 2008
Posts: 25



(Msg. 2) Posted: Tue Oct 06, 2009 4:25 pm
Post subject: Re: change text by validation [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"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 Surprised)

 >> Stay informed about: change text by validation 
Back to top
Login to vote
Bill Steele

External


Since: Mar 13, 2008
Posts: 14



(Msg. 3) Posted: Wed Oct 07, 2009 2:47 pm
Post subject: Re: change text by validation [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article ,
"Your Name" wrote:

> "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)

That should work. Thanks.
>
> 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.
 >> Stay informed about: change text by validation 
Back to top
Login to vote
Ursus

External


Since: Feb 13, 2009
Posts: 4



(Msg. 4) Posted: Wed Oct 07, 2009 3:25 pm
Post subject: Re: change text by validation [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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

Ursus
"Bill Steele" schreef in bericht

>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?
 >> Stay informed about: change text by validation 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
FileMaker 7 Text attribute will not change on layout - When placing a field on a layout I define the attributes of the color of text black, font type, and bold. It appears as defined in layout mode but when going to browse the text turns white. The field being placed on the layout is using the same table as...

Field Validation (FM Pro 6) - HI, I have a text field (FM PRO 6 Windows XP) named <type> displayed with a radio button checklist with 3 options: Yes No Past I would like to validate the field so that if it is currently set to "Past" it cannot be changed to Yes or N...

validation scripting - Here's the bare bones of a validation script I'm working on. Steps in brackets [] represent functions that don't seem to exist in FMPA: * set field ( titles::t_idv ; titles_lookup::t_idc ) * [ check validation of t_idv ] * If [ titles::t_idv does pass....

Relational and Validation - Hi, I've been reading up on Filemaker but I'm having difficulty establishing the following: 1. Is FileMaker Pro 9 a relational database. I've read that it stores its data and its table structure seperately and there's something relational about that..

Field validation and value lists - I have a field, which can be based on different value lists, depending on the context (on one layout it uses value list A, on another it uses value list B, etc.). My problem is how to validate it. The value in the field must be a member of the VL that....
   Database Help (Home) -> FileMaker All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]