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.

clear field with radio button?

Featured Replies

I have two radio buttons: 'print' and 'complete.' When the 'complete' radio button is clicked, I want the 'Days Past Due' field (which has a calculation) to clear (or show zero). How do I do this? thanks!

Do you want the field cleared of data? Thus losing the information about previous past due status.

Or do you simply want the "Past Due" field to show as up to date? Simply masking the information?

If the former, then you will need to script the procedure.

If the later, then you will need a display field to actually show the current status. Such as:

code:


PastDue_display = If ( Completed = "Yes", "", DaysPastDue )

Then you will need to script this. Lay a button over the field and when the user clicks it the field gets cleared and the status set to complete.

  • Author

No new radio buttons or fields will be created or moved. The radio buttons already exist -- 'Print' and 'Complete' (one value list). They are in the middle of the page and also are part of a field called 'Notes Office.'

The field "Days past due" exists and is to the right of the page (DB layout). I want the 'Complete' button to talk to the "Days past due" field" -- and clear it.

thanks, Harry

Ohh, OK. In that case you will need to script this.

Lay a button over the field and when the user clicks it the field gets cleared and the status set to complete.

  • Author

I cannot use a new field. The 'Days Past Due' field is no longer relevant when the "complete" button is chosen -- 'complete' means the bill has been paid. Therefore, a blank 'Days Past Due' field, or a zero, will work fine.

thanks, Harry

  • Author

I'm not clear on what you are saying and how it relates to what I've written. I don't know what "lay a button over the field" means. As I said, I don't want to move buttons -- sounds like you are asking me to do that. The button already exists... I guess my new question is: Can I click a button that is in its own field and have it affect -- clear -- a different field. Sounds like you are saying that it cannot do that.

Thanks, Harry crazy.gif

Harry,

What CaptKurt is saying does not mean you need any more fields.

The problem is your days past due. You say this is a calculation.

What is it calculated on.

If it is a calculation field, cant you add in

If( Complete="Yes", "", Show past due days)

If it is not a calculation field then do the following.

Basically, create an object (a rectangle will do) that sits over the top of your Yes option on your completed field.

Now, write a script

Set Field (Completed) "Yes"

Set field (Days past due) ""

Now, the rectangle you placed over the yes option on your completed field, click on it and choose format > button.

Choose perform script > the one you just wrote.

You can then set the fill and border colour to transparent.

  • Author

Kicking and screaming I have pretty much tried all the ideas that have been presented to me. I would have preferred a calculation, because that seemed to be the least messy solution. I have not had any success. I have been encountering 'too few separators' messages along with 'circular reference' messages as well as 'an operator expected here' messages.

My final attempt for the day was the Scriptmaker route -- here's my script:

Set Field ["(Notes Office) and "Complete" "]

Set field ["(Days past due) = "" "]

The 'and' and the '=' I guessed at because I was asked by the app to add an operator. I also created the invisible rectangle over the 'Complete' checkbox. All to no avail -- it doesn't work. Fortunately I had time to spend with this today -- major trial and error. Usually I can begin to start figuring these things out, but this one has me stumped.

My next try may be to make a simple trial DB and ad these calcs and scripts and see if I can get it to work. Your assistance is and has been greatly appreciated.

Thanks, Harry

quote:

Originally posted by Harry JJ:

I have two radio buttons: 'print' and 'complete.' When the 'complete' radio button is clicked, I want the 'Days Past Due' field (which has a calculation) to clear (or show zero). How do I do this? thanks!

Starting over:

The calc for DaysPastDue =

If(Complete = "Yes", "", whatever the original calc is)

That way, if the "Yes" answer in the "Complete" field is checked, DaysPastDue will be empty; otherwise, it will show the result of the calculation.

***********************

It seemed to me that this was an easy one; I guess I was mistaken.

  • Author

Following is a calculation from the 'Days past due' field. It needs separators. I don't know if the last line is legitimate code. I don't have a "yes" button, just 'Print" and "Complete" buttons that are within the 'Notes Office' field.

If(Today-Sort Date-30>0, (Today-Sort Date-30), "0" or

Case(Today-Sort Date-30>0, (Today-Sort Date-30) >=0, "0" and

If( Notes Office , "Complete" ) , Days past due , "" )))

How does this look or am I barking up the wrong tree? thanks

One field called DaysPastDue =

code:


If(

Today - Sort Date - 30 > 0, (Today - Sort Date - 30), "0"

)

Another field called cPastDue_display =

code:


If(

Notes Office = "Complete", DaysPastDue , ""

)

Mixing both into the same field is a sure way to confuse and lead to errors.

  • Author

Your solution is simple -- I like that. Let's try to make it work. The "Complete" button is in the "Notes Office" field. Here's how I wrote it:

If(Notes Office = "Complete") , "", or

If(Today-Sort Date-30>0, (Today-Sort Date-30), "0" or Case (Today-Sort Date-30 > 0, (Today-Sort Date-30) >=0, "0"))

I'm receiving the dialog box: "There are too few separators in this function." How can I make it work?

thanks, Harry

Well, well, duplicate posts! Tsk, tsk, tsk.

See my response on the other board.

  • Author

Sorry if I broke the rule. I decided to post in both places since I began both topics and the problem I was having was also directly relevent to my 'calculations-separators' topic in Fields. Now that I understand that the same users view both, I will not do that again.

Anyway, after I went through much trial and error, danjacoby appears to have solved my problem with this calc:

Case (Notes Office = "Complete", "",

Status(CurrentDate) - Sort Date-30>=0, Status(CurrentDate) - Sort Date-30, 0)

Thanks much to danjacoby, and to all who assisted. I'm sure I'll be back.

Harry

Create an account or sign in to comment

Important Information

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

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.