Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Applying a script to a checkbox

Featured Replies

  • Newbies

I've created a database for potential sponsors and have a checkbox that when checked shows the potential sponsor has become an actual sponsor.

I created a script and applied it to the checkbox so when the checkbox is clicked a new record is created in my confirmed sponsors database.

I've applied the script to the checkbox and it works. The problem is it won't actually put a check in the checkbox to show they've become a sponsor.

Is there a script action I can apply that allows a check to be put in the checkbox and also performs the script I've created?

Thanks for your help.

Just add a Set Field step to your new record script. The value that it sets it to should correspond to the value list you used to define the checkbox. I typically make a value list called One, with a value of 1, which makes it very easy to work with the data in scripts and calculations.

Also you'll want to add to your script some logic to deal with what happens if the checkbox is already checked/the record has already been created.

Have you tried the "Set Field (YourCheckBox; "YourAnswer") yet?

Lee

  • Author
  • Newbies

Thanks for the suggestion. In theory I understand what you're suggesting but because I'm a newbie I don't know how to actually put it into practice.

I'm confused about the value list and the value. My value list is called Confirmed Sponsor. I only had one value listed which was confirmed sponsor. I changed the value to 1 to see if that would do it but it didn't. I guess I'm just not clear how to implement the set field so the checkbox gets checked before the rest of the script is performed.

Also if the box is checked I'd like nothing but the box to get unchecked if it's clicked again. Can you suggest how I put that in the script as well?

Thanks again for the help.

Both Fitch and I supplied essentially the same answer to your original question, which means that we both read it the same.

Either paste a copy of your script, or your file, so that we can see what your script looks like.

Lee

  • Author
  • Newbies

Thanks Lee, here's the script

Enter Browse Mode[]

Set Field[Potential Sponsors::Confirmed Sponsor]

Go to Layout["Confirmed Sponsor Detail" (Confirmed Sponsors)]

New Record/Request

Go to Field[Confirmed Sponsors::Company]

My point was that when you use the Set Field script step, you need to set the field to a value that belongs to your value list.* If "confirmed sponsor" is in the value list, you'd set the checkbox field to "confirmed sponsor." I used "1" as an example because it's good practice, although not applicable in every situation.

I inferred from your first post that you were at least a little familiar with ScriptMaker. Take a look at the attached file and see if it makes sense.

[color:gray]*It doesn't matter what your value list is called, but it does matter what the values are, because e.g. if your value list contains only the number "1" and you set the field to "1" it will show a checkbox, but if you set the field to "banana" the checkbox will display as empty, even though it actually contains the value "banana," because "banana" is not a member of the value list.

checkbox.zip

In your script example you specified the field, but you didn't specify what data to put in it.

  • Author
  • Newbies

Thanks Fitch that was so very helpful. It took me a minute to figure out what you did, this is my first day working with scripts, but I have it working exactly as I wanted thanks to your example. You just saved me at least a couple of days of stress and strife.

:yourock:

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.