Create a field that records time box is checked

New Here ,
May 13, 2022 May 13, 2022

Copy link to clipboard

Copied

I'm trying to create a simple weekly task list. I want to create a field, in this case it would be "MCB1", that when I press that button, the box (MCB1) will show the current date and time. Although I found a way to populate the date and time in the box, the field updates whenever other box is pressed. I was hoping to find a way to record the date and time and not have field update again.

TOPICS
JavaScript

Views

341

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Adobe Community Professional , May 14, 2022 May 14, 2022

Set condition to populate field only when it's empty:

if(this.getField("MCB1").valueAsString  == ""){
//Your script goes here...
}

Likes

Translate

Translate
Adobe Community Professional ,
May 14, 2022 May 14, 2022

Copy link to clipboard

Copied

What script does you use? Where does you use the script?

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 14, 2022 May 14, 2022

Copy link to clipboard

Copied

LATEST

This is the one I found online. MB1 is a check box that you would have to push to fill in the date/time for MCB1.

event.value = this.getField("MB1").value=="Off" ? "" : util.printd("HH:MM", new Date());

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
May 14, 2022 May 14, 2022

Copy link to clipboard

Copied

Set condition to populate field only when it's empty:

if(this.getField("MCB1").valueAsString  == ""){
//Your script goes here...
}

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines