{"id":16986847,"date":"2023-08-20T13:18:28","date_gmt":"2023-08-20T13:18:28","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/required-inputs\/"},"modified":"2023-08-20T13:18:28","modified_gmt":"2023-08-20T13:18:28","slug":"required-inputs","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/required-inputs\/","title":{"rendered":"Required inputs"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Hello,<br \/>I am currently using a multi-step form, and on a page there is a checkbox that if selected some input fields become required, but if I leave these required fields in the default form in the field and these are not filled in, the submission will not proceed.<br \/>My question is whether there is an option to use the $form object in JavaScript, to enable this field to be required by default using JavaScript in the moment the checkbox field is selected, I am currently using JavaScript to make these input fields required in the HTML, but this is not  an elegant way.<br \/>Thank you.<\/p>\n","protected":false},"template":"","class_list":["post-16986847","topic","type-topic","status-publish","hentry","topic-tag-input","topic-tag-javascript"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/16986847","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/16986847\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=16986847"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}