I was recently working on a WordPress form that uses the Contact Form 7 plug-in to build out the form. The client reached out and wanted a new checkbox that, when checked, would make certain fields display and mark them as required. When not checked, they wouldn’t be required or display to be filled in. Here’s the solution I came up with.
Use JQuery to see if a checkbox is checked
There are times with JQuery that you may need to see if a checkbox is checked or not, and based on that value, do certain things. This little snippet has come in handy a lot for a project I’ve been working on lately. Simply do the following: