Skip to main content
Participant
June 18, 2023
Answered

Radio button Javascript

  • June 18, 2023
  • 1 reply
  • 606 views

Hi all
I'm wanting to put in some formulas to make the completion of the below form easier for my trainers and i've not used javascript before, so i'm not really sure where to start. 

I would like to make it so that if they tick satisfactory in Practical assessment 1, the date from the top is put into the date field. Is this even possible?

 

This topic has been closed for replies.
Correct answer Nesa Nurani

Let's say the export value of 'Practical assessment 1' for 'satisfactory' is 'Choice1', as 'Custom calculation script' of 'date' field use this:

var PA1 = this.getField("Practical assessment 1").valueAsString;
var datefield = this.getField("Date").valueAsString;
event.value = PA1 === "Choice1" ? datefield : "";

1 reply

Nesa Nurani
Community Expert
Nesa NuraniCommunity ExpertCorrect answer
Community Expert
June 19, 2023

Let's say the export value of 'Practical assessment 1' for 'satisfactory' is 'Choice1', as 'Custom calculation script' of 'date' field use this:

var PA1 = this.getField("Practical assessment 1").valueAsString;
var datefield = this.getField("Date").valueAsString;
event.value = PA1 === "Choice1" ? datefield : "";
Participant
June 19, 2023

That is fantastic - thank you Nesa!