Jump to content
Server Maintenance This Week. ×

What did the user de-select?


djc728

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

Recommended Posts

Hello all:

I have another head banger question here. I have a text field that displays values as check boxes from a value list. On that field I have a button script. I would like to be able to run code if the user has de-selected a checkbox. How can you find out if the checkbox was indeed unselected thru the button script. I tried using pattern count but the value of the checkbox even though its de-selected is still in the list. Is it a question of the record not being committed?

Basically I want to test if the checkbox is de-selected and then run some code but when I check the field the checkbox I de-selected is still present in the list. I guess the real question is when does the value list get updated? Is it upon leaving the record, leaving the field???

Thanks.

Dom

Link to comment
Share on other sites

Check boxes are just an interface to a plain text field that is a return separated list.

To determine if an item is selected or not you need to use a pattern count to test if the

item is checked/ or unchecked.

You are basically wanting to run a script to add or remove the item from the list?

take a look at this...

http://www.briandunning.com/cf/142

Link to comment
Share on other sites

If I run a checking script from any field other than the field that displays the check boxes I'm ok BUT I want to be able to click the Checkbox field and run the script from that field to check but if a checkbox is checked and I'm unchecking it -- when the script runs Patterncount still sees that checkbox as being in that field. What am I missing here?

Link to comment
Share on other sites

I'm confused as to what you are wanting.

I first read your question as you wanting a log of changes in the [color:blue]checkbox field. i.e. checkbox had "[color:blue]Yes" selected, and user changes it to "[color:blue]No". this you can do using a Field Modification Tracking, or Audit File. There are dozens of threads on this subject, and example files available. Start with these two sites. Database Pros and NightWing Enterprises and search for the file type mentioned.

Then after Ocean West had replied, I read it as you wanting to activate a script upon the entry of a checkbox response. If this is what you are after, then you will need a plugin.

HTH

Lee

Link to comment
Share on other sites

Lee:

Yes I want to activate a script upon the entry of a checkbox. Again, with 4D this is a simple thing thus my frustration when trying to do the same thing in Filemaker. I do love Filemaker very much but its these kind of things that drive me crazy. Layout and or field triggers are really whats needed. I could go the plugin route but I'd really like to do natively if at all possible.

Thanks.

Dom

Link to comment
Share on other sites

If you make your field a button, then the user cannot enter the field to modify it. But you can use the field for displaying the choices made.

Why don't you overlay the field with several buttons (one per value). Then have your script change the content of the field, then do something else.

P.S. A more specific example would be useful.

Edited by Guest
Link to comment
Share on other sites

If the values come from another field and are dynamic, that wouldn't work. But if you make the field a button and include a script step Go to Field (the field itself), the user can indeed enter the field and select values.

Link to comment
Share on other sites

You could let the user enter the field - and then what?

If the value list is dynamic, I would probably use a portal to display it. In fact, if the value list is static, I would prefer to use a repeating field for the display.

Link to comment
Share on other sites

(I would use a portal too.)

I suppose the script could first save the list of selected values to a global field or global variable. Then allow entry.

That would permit a comparison of before and after. Sorry, I haven't thought it through.

Link to comment
Share on other sites

First off I want to thank everyone who responded. You all gave some great ideas. I'll try to explain exactly what I have and I hope it makes senses.

I have a text fields A which is displayed as a checkbox and has 5 values. Now each of those values has a corresponding text field B so I have 5 more text field B's on the layout. Text Field B is displayed as a radio button.

The problem was if a user clicks a check box then and only then will he have access to click the text field B radio button corresponding to that checkbox. I made the Text field B radio buttons non-enterable and I have a script under that that brings up a custom dialog with the 2 radio button choices.

NOW, however, if the user unchecks the checkbox and the corresponding radio button has a value -- I wanted a way to clear out the radio button and make the field blank. The problem I had was how do you know which checkbox the user has clicked on. Patterncount won't work because all that does is give you the boxes that are checked and I need to know which one specificially the user clicked on. I could overlay a button on each checkbox item and that should work but my frustration comes about because in 4D this would be a very simple thing to accomplish where in FM I have to be a bit more creative. I'm not complaining because I do love FM very much and it does have its good points so I apologize for venting a bit. I hope this explains it a bit better.

Thanks again all for your input. As an aside, I find this forum very good and have gotten a lot of great feedback and ideas. I just have to get back into the FM mode of thinking.

Dom

Link to comment
Share on other sites

This topic is 6183 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.