Trying to make SOME but not all form items required | XM Community
Skip to main content
I have a form field with 9 different items. I need just a couple of them to be required. Does anyone know if this can be done with custom code?



Thanks in advance!
Hi

You can use custom validation

as in the image below to only make some form field mandatory.

!
I feel stupid for not figuring that one out. Thank you @NIC. On a separate note, I noticed many of my form fields wrap onto 2 lines and the text ends up looking really close together. Do you know if there is any way to add a bit of spacing inbetween each form line.
> @uhrxx005 said:

> I feel stupid for not figuring that one out. Thank you @NIC. On a separate note, I noticed many of my form fields wrap onto 2 lines and the text ends up looking really close together. Do you know if there is any way to add a bit of spacing inbetween each form line.



Paste the below code in the js(OnReady) of the form question type:



`jQuery("#"+this.questionId+" .ChoiceStructure table").css("border-spacing", "10px 40px");`
Just FYI, this is now even easier. Now by clicking "Click here to edit form fields" you will get an option to force response for each individual row.

Leave a Reply