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.

beginner script question, howto check checkbox ?

Featured Replies

I have no idea how to check a checkbox in a script, i have tried Go to Field[select/perform, "field name"]

sorry for a dumb question blush.gif

Infected:

Welcome to the Forums. There's no such thing as a dumb question.

To check a checkbox in a script, use SetField(yourfield, value), where yourfield is the field you are entering data in, and value is the value of the checkbox. In other words, if you've got a field named "MyField" in a layout, and the checkboxes are set to "Yes" and "No", and you want to check off the "Yes" box, your SetField statement would look like this:

SetField(MyField, "Yes")

Setting a field to Checkbox or Radio Button is just a layout choice. The underlying data is comma-delimited actual data. To see what's really happening, put a regular textbox of the same field next to your checkbox field. As you check things off, you'll see they appear in text in the textbox...

HTH

-Stanley

  • Author

I have a very strange problem, i have previously tried the "YES" method and it hasn't worked for me. So i reversed the method, left it checked and change the script to "NO" it does uncheck it.

works one way and doesn't the other way.

any ideas?

Hi, infected! I'm not sure it matters in this particular situation, but I'd just double-check (pun!) to make sure that the "YES" in the script is exactly the same as the "YES" in the field or valuelist. I've had problems on the web where a field had YES followed by a return character or space or something and it did not work right. Sometimes things like that matter, sometimes not... but try to make sure it is EXACTLY the same (upper/lowercase, spelling, extraneous characters before or after, etc.).

--ST

Infected:

Make sure that you're setting the field to the EXACT value of one of the checkboxes. Otherwise you won't see the data in the field if it is formatted as a checkbox. However, some data will definitely be there. I can't remember if checkboxes are case-sensitive, but I believe that they are. So, if you're setting the field to "YES" and the checkbox says "Yes" then the checkbox will remain unchecked.

So, my advice to you is the same as what I wrote before. Put a regular text field of the same field next to your checkboxes, observe what happens when you check the boxes, then observe what happens when you run your script. The problem should become clearer then.

-Stanley

  • Author

thanks a lot steve, your suggestion worked. the value list had "pack" in it. I haven't made the DB. thanks a lot to everyone. grin.gif

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.