Resolving mandatory field hidden by Javascript issue

By: Oliver Honeywill | Asked: 10/14/2022
ForumsCategory: Paid Help WantedResolving mandatory field hidden by Javascript issue
Oliver Honeywill asked 2 years ago
We have three instances of a form, on separate WordPress sites, that all use an Ideal Postcode plugin to assess whether or not a postcode is:
  • In-Area
  • Out-of Area
  • Beyond Area
The plugin correctly assesses the postcodes, and for the Out of Area postcodes displays a disclaimer and checkbox to confirm registration as Out of Area patient. However, the checkbox cannot be mandatory, because when made so, the field, correctly hidden by the javascript for In-Area postcodes, is invoked when trying to 'continue' to the next screen, and progression to the next screen is impossible until the In Area registration confirms Out of Area registration. So we have no way to enforce the confirmation of Out of Area registration when correctly displayed - which seems improbable. Can anyone help? Here are the three forms:
  1. https://www.holbornmedicalcentre.nhs.uk/clinics-and-services/services/registering-with-the-practice/
  2. https://www.stphilipsmedicalcentre.nhs.uk/about-us/registering-with-the-practice/new-patient-registration-form/
  3. https://www.holbornstudenthealth.com/registration-for-students/
 
1 Answers
Bobby Clapp answered 2 years ago
This will require some custom code in my mind. You'll need to work out the exact code on your own, but here is a start: https://www.w3schools.com/howto/howto_js_display_checkbox_text.asp
Rob LeVineRob LeVine replied 2 years ago

I agree with Bobby on this. I've coded different variations on this theme from two angles: 1 - removing the requirement on a field that's hidden but not removed from the DOM and 2 - adding a requirement to a field that didn't currently have one. I've found it can be a moderate project, as opposed to simple and hard because often you have to make the field both look and act as you require.

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right