Thanks for your post.
you are able to do so by enter Layout mode. Right Click on the date field, and Select Field/Control - Setup.
Instead of selecting Edit-mode as the standard is, select dropdown calendar. Click OK. You also can select if you want the user to see the arrow for the calendar.
hope that helps.
Your suggested 'fix' does not prevent the user from typing into the calendar field. Try it.
Thanks for the suggestion.
If using FMP 10, you might be able to use a script trigger that responds to each keystroke and rejects them. I'd have to play with that to see if it'd really work well, but it might work for you.
As usual, your idea is a good one. I have implemented a scripttrigger using on keystroke and it does indeed fire (and display a message).
The only problem is I can't figure out how to 'blank' the date field and remove what is typed???
I have tried Set Field ........; "" and
Set Field ........; isempty(field)
Got any better ideas?
All you need is a one line script:
Exit Script [Result: False]
The existing problem is that if I enter 'e' (or any invalid charater) I can exit the script but the invalid character remains. If I put a dialog box above the Exit and remind the user to 'delete the invalid character'... then it is run twice... once for the invalid character trap and again when they press >delete<.
Isn't there some way that is more elegant? I just finished looking at all the functions and tried about 6 of them and none seemed to solve the problem.
set error capture [on]
show custom dialog...
insert calculated result
They all leave the invlid character in the field.... Surely FM has a way to delete an invalid character from a field!??
When I tested the script trigger example that I posted. The field remains blank after I try to type in it. The Exit Script [value: false] step exits the key press event before the key value is entered into the date field.
Use just that one line, nothing else except any comments you want in your script and test it. No need for a custom dialog step or anything.
hmmm... I think it isn't working for me because I don't know how to specify the [Value: False] part. How do I do that?
Add the Exit Script step to your script
Type in the word False (no quotes).
Save your script
Thanks. I created the Exit step as you showed me. And I put it in a scripttrigger OnOBJECTKeystroke
Works like a charm. If you have a quick question. Exactly what's going on with Result FALSE?
(If you don't have a quick explanation, that's ok. I can research it.)
Exactly what's going on with Result FALSE?
It prevents the orig action from happening. In this case, it was a keyboard action so if true it would allow they keystrokes that you typed to go on, if false it doesnt send them through.
Each script trigger falls in one of two categories:
Those that run the trigger script before the triggering event (such as the one in this thread) and those that run the script after the event.
This is all documented in a nice table in the online help.
Thanks Phil for the explanation.
I also found a rather lengthy explanation along the lines you provided in "Filemaker Pro 10 Bible" by Ray Cologon.
This question was a great 'learning' experience for me.
Thanks to all who contributed....