Jump to content
Server Maintenance This Week. ×

This topic is 2441 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hi guys

Hoping for some intellectual input from those more experienced than I.

I am trying to create a "portable tick box"

By this I mean a script that I can attach to any field to make it a tick box

So far I have created a number field and set it to display all non zero values as a tick.
I have then attached a scriptrigger which runs a script on entering the field

The script is as follows:  Set Field by Name [Get (ActiveFieldTableName)& ::" & get (ActiveFieldName);Abs (Get (ActiveFieldName)& "::" & get (ActiveFieldName)-1)]

 

This way if the field is empty it will be set to 1 and if it isn't it will be set to zero.

So far, when I click into the field it correctly sets it to 1 and displays the tick but it remains at 1 and won't zero which I don't understand.

 

Can anyone see the flaw?

 

Joseph

Link to comment
Share on other sites

Awesome. This works really well.

I notice though that by using this method, that the 1 or 0 becomes momentarily visible before seeing the tick

If I set the field directly ( set field rather than set fieldbyname) that the 1 or zero is not displayed

Link to comment
Share on other sites

2 minutes ago, eyedoctor said:

I notice though that by using this method, that the 1 or 0 becomes momentarily visible before seeing the tick

That is the nature of the hack you have devised: a script triggered OnObjectEnter runs after entering the field - and while a field is active it will display its contents unformatted. If you use a button instead, the field won't be entered at all and you won't see the raw contents.

What is the purpose of these boxes?

 

Link to comment
Share on other sites

They are just tick boxes.

Look better than the native Filemaker ones.

Problem with attaching a script, is that the field is not entered and so the Get(active fieldname) won't work because the field is never active

Link to comment
Share on other sites

1 hour ago, eyedoctor said:

Problem with attaching a script, is that the field is not entered and so the Get(active fieldname) won't work because the field is never active

That is correct: you need to use a script parameter to identify the field. Or attach a single-step action to each button.

Link to comment
Share on other sites

This topic is 2441 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.