I would like to replace the null record with N/A when possible in JavaScript.
I have the form, where some of the questions are reliant on other questions. If, for instance, some of the questions in marked as "yes" then other questions are not required, therefore they're inactive, as per below.
Next, I've prepared the email form like shown here:
HTML Assigning the checkbox to the form action already defined
and everywhere, where I have the unanswered question (while inactive ones) the result shows null.
I would like to have N/A instead of null everywhere, where questions are to be inactive due to selection.
My initial code looks like this:
var surveyFailure = formData.get('h3g_survey_failure_reason');
and I tried something like this:
var surveyFailure = if
formData.get('h3g_survey_failure_reason') = null {
surveyFailure = "N/A"
};
but it doesn't work, as i get
Uncaught SyntaxError: Unexpected token 'if'
Is there any chance to replace the null with N/A?
Full code is available here:
