Skip to main content
trf22
Participating Frequently
January 10, 2023
Question

Copy a text field based on checkbox value

  • January 10, 2023
  • 1 reply
  • 3987 views

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. 

This topic has been closed for replies.

1 reply

Nesa Nurani
Community Expert
Community Expert
January 10, 2023

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;}

trf22
trf22Author
Participating Frequently
January 10, 2023

Thank you so much. I'm new to Java. This is a very dumb question. Where do I put this? 

trf22
trf22Author
Participating Frequently
January 10, 2023

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.