Default value to be hidden | XM Community
Skip to main content

I am working with Text Entry.
I am trying to have a default response for any empty Text Entry to be "N/A" at the outcome.
Is there a way for a default value to be hidden so that if there is no response, it gets "N/A" as outcome (instead of having "N/A" inside Text Entry already)?

Use this code in jS onReady function. The below code will make text entry N/A if its empty, for all text entry input on that page.
jQuery("#NextButton").on('click',function(){

jQuery(".InputText").each(function(){
if(jQuery(this).val().trim()==""){jQuery(this).val("N/A");}
});

});


@rondev Thanks for the jQuery. I will apply it.
I have another question.
Regards to Required Field (Force Response), is there anyway to customize it to all questions together instead of getting a generic message "Please answer this question."?
I am trying to say "Please answer this question. If you do not have an answer, please indicate N/A" on all questions together.
Thanks.


I have another question.:
Here is the code:
jQuery(".ValidationError").html("Please answer this question. If you do not have an answer, please indicate N/A");


rondev Thanks a lot.
I guess we have to put the code individually on each question or is there anyway we could do it as "Custom Validation (which I am not familiar at this point)"?


Leave a Reply