Skip to main content
Participant
March 1, 2021
Answered

Filling a single field with values from fields in a table

  • March 1, 2021
  • 1 reply
  • 892 views

I am trying to create a checklist to be filled in by coworkers to check if things are done correctly. To improve ease of use I wanted to create a kind of user interface as page with only the description of the current check on there, and then two buttons, one for ok and one for not ok. When the button is pressed it should put a check to the corresponding checkfield and the description field should update to the next check that needs to be done. However I find it difficult to program this. I have looked into hierarchical naming and loops but I can't get it to work in practice. Does someone have tips for the direction that i need to look in or links to relevant litterature? I have looked all over google but maybe I am searching for the wrong thing, I am very much a beginner in coding and don't have a lot of experience.

Thank you so much in advance...

This topic has been closed for replies.
Correct answer try67

Ah yes, I should add another row with checkboxes for if the criteria is not ok. But how can I code so that when a button is pressed, the title and description go to the next check in line, so from 1.4 to 1.5 for example?


You can use something like this as the MouseUp event of the OK button:

 

for (var i=0; i<=12; i++) {
	if (this.getField("check1."+i).valueAsString=="Off") {
		this.getField("check1."+i).checkThisBox(0, true);
		if (i==12) {
			this.getField("uititle").value = "ALL DONE";
			this.getField("uidescription").value = "ALL DONE";
		} else {
			this.getField("uititle").value = this.getField("title1."+(i+1)).valueAsString;
			this.getField("uidescription").value = this.getField("description1."+(i+1)).valueAsString;
		}
		break;
	}
}

1 reply

try67
Community Expert
Community Expert
March 1, 2021

It might be easier to help you if we could see the file in question... Can you share it with us?

Thijs5C35Author
Participant
March 1, 2021

Thanks for your quick response. Sorry, I forgot to add the file. it is very much a concept still but i cant find information on how I could program it. My idea was that the first page would act as a database of some sorts from where the second page would fill, and then when you press the ok button, a check would be added to the corresponding box. that would also make the first page a compact output that can be archived. I looked into doing it with a loop, but I couldn't get it to work.

try67
Community Expert
Community Expert
March 1, 2021

OK, I undestand it better now, except for the Not OK button. If the user clicks it then nothing changes, as far as I can see...