I recently needed to remove the asterisks from all required form fields. My form design was such that all fields are required, and I needed to use the asterisk character to point to a terms and conditions footnote.
Here’s the JavaScript I added to my page to remove the asterisks from all required field labels. Script placement is “Head” and jQuery is loaded. Enjoy:
<br /> jQuery(document).ready(function() {<br /> jQuery('form .lp-pom-form-field label').text(function(i, text) {<br /> if ('*' == text.slice(-1)) return text.slice(0, -2);<br /> return text;<br /> });<br /> });<br />
One could easily modify this script to target only certain fields, by selecting on field IDs instead of the class. Any improvements?
If this script helps you out drop a Like or a Comment 🙂