Jump 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.

Value list button labels

Featured Replies

  • Newbies

Hello all,

I have a yes/no type of variable in FM Pro 5 that I want to use a radio button for. The trick is that I want the user to see the words 'Yes' and 'No' next to the buttons, but have FM actually store a 1 or 0 respectively if the user clicks 'Yes' or 'No'. Is this possible?

Ron

quote:

Originally posted by stewarr1:

Hello all,

I have a yes/no type of variable in FM Pro 5 that I want to use a radio button for. The trick is that I want the user to see the words 'Yes' and 'No' next to the buttons, but have FM actually store a 1 or 0 respectively if the user clicks 'Yes' or 'No'. Is this possible?

Create your value list as 1 and 0. When you put the field on the layout, size it so that only the actual buttons are shown. Then simply put "Yes" and "No" on the layout as text next to the appropriate button.

------------------

=-=-=-=-=-=-=-=-=-=-=-=-=

Kurt Knippel

Consultant

Database Resources

mailto:[email protected]

http://www.database-resources.com

=-=-=-=-=-=-=-=-=-=-=-=-=

  • Author
  • Newbies

Kurt,

Thanks for the suggestion. This would work OK if the circles for the 'yes' and 'no' options are on top of one another. However, I would like it to look like this:

O Yes O No

and not like this:

O Yes

O No

When I put the field on the layout it comes out like this:

O 0 O 1

Is there a way to resize the above to get rid of the '0' and '1' and keep it horizontal?

Ron

quote:

Originally posted by captkurt:

Create your value list as 1 and 0. When you put the field on the layout, size it so that only the actual buttons are shown. Then simply put "Yes" and "No" on the layout as text next to the appropriate button.


User two fields and a couple of scripts. Have one field called Value_Yes and another field called Value_No. Each one can have a value of either 1 or empty. Place them on your layout and format the field boundaries so that the 1 from the value list is not visible, and place them on the same horizontal line. Put text to the left of each one for Yes and No.

Now create two scripts. Set_Value_To_Yes and Set_Value_To_No.

Set_Value_To_Yes has two lines:

Set Field [ Value_Yes, 1 ]

Set Field [ Value_No, "" ]

Set_Value_To_No is the reverse:

Set Field [ Value_No, 1 ]

Set Field [ Value_Yes, "" ]

Attach the scripts to the Value_Yes and Value_No fields.

Chuck

  • Author
  • Newbies

Thanks Chuck, I'll give that a try.

quote:

Originally posted by Chuck:

User two fields and a couple of scripts. Have one field called Value_Yes and another field called Value_No. Each one can have a value of either 1 or empty. Place them on your layout and format the field boundaries so that the 1 from the value list is not visible, and place them on the same horizontal line. Put text to the left of each one for Yes and No.

Now create two scripts. Set_Value_To_Yes and Set_Value_To_No.

Set_Value_To_Yes has two lines:

Set Field [ Value_Yes, 1 ]

Set Field [ Value_No, "" ]

Set_Value_To_No is the reverse:

Set Field [ Value_No, 1 ]

Set Field [ Value_Yes, "" ]

Attach the scripts to the Value_Yes and Value_No fields.

Chuck

  • 4 weeks later...
  • Newbies

Why not create two value lists. One called Yes contains value 1. Second No contains value 0. Then just place your field on the layout twice with the different value lists. Hide the 1 & 0 and just place yes or no next to them.

I try to avoid the use of scripts to modify field data whenever possible.

Use the radio buttons to enter yes or no. Create a calculation field...

If(field="yes", "1", "0")

What could be simpler and more reliable than this? No fancy layout tricks needed, no tricky scripts either. Nothing to break in the future.

Create an account or sign in to comment

Important Information

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

Account

Navigation

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.