August 3, 20169 yr Hi, I'm not sure where to start on my script, but the plan is: I have 3 fields, Field A, Field B and Field C Each displays calculated data (in this instance dates) and each field is a button. I'm trying to get it so that when the user clicks one of the fields, it sets another field (or variable, but I don't have much experience with those) to that field's value. I could create 3 scripts, one for each field. I could also create a script that selects the contents of the selected field and copy and pastes it into another field. But both these methods seem a little cumbersome. Does anyone have any ideas how i can do this in a single script suitable for all fields? I'm thinking something like: "Set Field X to Current Field", but I'm not aware of any such script step. Thank you in advance for any help.
August 3, 20169 yr 34 minutes ago, Ninja said: each field is a button. When a field is formatted as a button, the user clicks on the button, not on the field - and the underlying field does not become active in the process. 37 minutes ago, Ninja said: how i can do this in a single script suitable for all fields? Use a script parameter and attach a different parameter to each button.
August 3, 20169 yr Use script parameters as Comment said to tell the script that which button has been clicked. Instead of adding buttons on top of fields, use script triggers to run the script. Either "on object entre" or "on objecmodified" (if I am not mistaken by names of triggers.
August 4, 20169 yr Author Ah script parameters. I've not used those before but they worked perfectly! Thank you. I elected to set the fields to buttons rather than using script triggers (thank you for the suggestion siroos), as entering the fields cause them to look slightly odd, and the parameters were able to predict the field's content in the way I was using them. Thank you both for your help.
Create an account or sign in to comment