Solved

AFTER ENTERING DATA INTO A FIELD THEN FIELD SHOULD APPEAR...........

Posted on 2004-08-23
10
268 Views
Last Modified: 2012-05-05
What function or script I should use for special fields such as phone numbers , social sec numbers.

Example:

If I enter phone number    5593512032 in a phone number field, when  I move to next record or exit  then the phone number field should appear as  (559)- 351-2032 or 559-351-2032  and same thing with Socaial Secuirty field  if I enter 603456743 after moving to next record or exiting the last field ( Social secuirty field )should appear as 603-45-6743.

Any suggestions. Help please !!



                                                                         


0
Comment
Question by:gurshaan
10 Comments
 
LVL 9

Accepted Solution

by:
prifre earned 43 total points
ID: 11878426
Actually this is not so easy. The reason is that FileMaker does not enable you to automatically run a script (that would fix a field contents) after the data have been entered an fix it.

You could use a calculated field that takes the result from the first entered field, and calculates that one so the result looks nice in the calculated field and then just use the Calculated field when displaying the Phone.

Another difference is to enter them in an ugly way and then to manually start a script that would go through all the ugly phone numbers/socnumbers and fix them to be pretty. But that would mean you would have to edit them as pretty and they would be permanent in that field.

Another solution is to use FileMaker only as an engine and to handle everything through serverscripting and via a web-page. But that is something completely different.

So to sum it up - it is not really possible to do it perfectly (display something formatted, but edit unformatted) based on scripting, since FileMaker cannot do that well.
But you can get it nice via buttons and caculated fields when you actually need it (when printing, etc).

hope that helps
with a smile
/prifre
0
 
LVL 28

Assisted Solution

by:lesouef
lesouef earned 41 total points
ID: 11886010
I use RunScript.fmx which is a free plug-in which allows to trigger a script when you tab to next field, or click outside it.
So write the formatting script, and trigger it with that stuff. Absolutely magic!
Since I don't remember when I got it from, here is copy: http://extranet.valblor.com/~lesouef/RunScript.fmx

prifre: try it also, you'll like it.
0
 
LVL 19

Assisted Solution

by:billmercer
billmercer earned 41 total points
ID: 11893984
Lack of good input masks and field formats is probably my biggest gripe about Filemaker. To get the visual effect you describe, this technique works pretty well. This example is for a 10 digit US phone number field called PHONE.

- Create an unstored calculated field called PhoneFmt, make it equal to
"(" & Left(PHONE,3) & ")" & Middle(PHONE,4,3) & "-" & Right(PHONE,4)
- Add this new field to your data entry layout.
- Set the background color of PhoneFmt to the same color as your layout's background.
- In the properties for PhoneFmt, uncheck the "Allow entry into field" option.
- Place the calculated field on top of the original phone number field so it covers it completely.  
Now, when you look at the layout you only see the formatted field that can't be edited. But if you click on it, it highlights the editable field underneath, which then becomes visible. Edit the number, and when you leave the field, the formatted calculation pops on top again, showing the formatted change.
Once you've created this on your layout, group the elements so you can move it around easily.

The hardest part of this is defining the calculation to do the formatting. Hi Voltage has a free plugin that makes this super-easy. If you download it, they also include a sample database that uses the same technique I described above.

http://www.hi-voltage.com.au/download.php 

P.S. lesouef, thanks for the scripting plugin. I love stuff like that!
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 28

Expert Comment

by:lesouef
ID: 11894228
I forgot to mention how it works:
You should use the external function
EXTERNAL("FMcs-CallScript", "[script name]")
in the 'control by calculation' property of the field.
(Names may be wrong, I have the same pb as prifre, not using an english version.)
It does nothing if the field is entered but left unchanged.
0
 
LVL 19

Expert Comment

by:billmercer
ID: 12203801
Split it.
0
 
LVL 28

Expert Comment

by:lesouef
ID: 12204490
agreed.
0
 

Author Comment

by:gurshaan
ID: 13636701
Thanks Guys

I will try all of the options. You guys been very helpful.


Thanks again
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Filemaker Pro 13 Adv - Label printing 17 347
change filemaker server web direct port 1 193
How to create table occurrences to display filtered data..?? 1 562
filemaker security 1 705
Problem: You have a hosted FileMaker database and users are tired of having to use Open Remote or Open Recent to access the database. They say, "can't you just give us something to double-click on rather than have to go through those dialogs?" An…
Having just upgraded from Filemaker 11 to Filemaker 12 over the weekend, we thought we would add some tips for others making the same move.  In general, our installation went without incident. Please note that this is not a replacement for Chapter 5…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question