Copy a text field based on checkbox value
Copy link to clipboard
Copied
I would like to copy selection based on if a check box is selected. How can I do this. I have attached a screenshot of what I am wanting.
The user will slect the time they need our service on Monday. I have a box they can select if it is the same all week. If so I would like the rest of the days to auto populate to match monday.
I want the same thing for sunday.
Copy link to clipboard
Copied
Here is a basic script as 'Mouse UP' action of checkbox:
if(event.target.value != "Off"){
this.getField("Tuesday").value = this.getField("Monday").value;
this.getField("Wednesday").value = this.getField("Monday").value;
this.getField("Thursday").value = this.getField("Monday").value;
this.getField("Friday").value = this.getField("Monday").value;}
Copy link to clipboard
Copied
Thank you so much. I'm new to Java. This is a very dumb question. Where do I put this?
Copy link to clipboard
Copied
Also do I post the entire script you sent me?
Would it be the same for the 2nd checkbox? If they check the box under saturday I want it to autopopulate sunday.
Copy link to clipboard
Copied
I tried it but I guess Im doing it wrong. Not sure how to make it work. I attached the file if that helps.
Copy link to clipboard
Copied
Script is in checkbox → Properties → Actions Tab → Select trigger: Mouse UP → Select action: Run a JavaScript.
Here is your file with scripts added:
https://drive.google.com/file/d/1zLtUrXzGPPJKvVeEw0zRTBvNL-UQL_Fg/view?usp=share_link
Copy link to clipboard
Copied
You are amazing! Is there a way to make the To line populate to. Both to and from?
Copy link to clipboard
Copied
Forgot attachement...
Copy link to clipboard
Copied
Copy link to clipboard
Copied
This is perfect. One last thing. Is it possible to make the checkboxes abvoe the other days check as well? If so I would like them to be checked if they select same all week or same saturday and sunday.
Copy link to clipboard
Copied
Sure, do you also want to add if checkbox is unchecked to revert field values to default?
EDIT:
Here you go https://drive.google.com/file/d/1O2dyMQcDtPa9868MH-aHO76b7AYWM4qk/view?usp=share_link
Copy link to clipboard
Copied
I'm not sure what that means. If the check box is unchecked that means the user should fill out each day.
Copy link to clipboard
Copied
This is PERFECT. Thank you. I want to learn how to do this.

