I agree with @webex regarding this thread : How to remove the word “optional” next to required fields, and put an asterisk after a required field
So here is a quick fix ( jQuery snippet ) :
jQuery(document).ready(function($) {
$('.hp-form__field input[required]').each(function() {
// Find the label associated with the required input
var label = $(this).closest('.hp-form__field').find('.hp-field__label span');
// Check if the star is already added to avoid duplicates
if (!label.text().includes('*')) {
//add css class : .req{color:red;font-weight:bold;font-size:1.2em}
label.append(' <span class="req">*</span>');
}
});
});
CSS :
/*remove (optional)*/
.hp-field__label small {font-size: 0;}
.hp-field__label small:after {content:''; font-size: small;}
/*style for required field asterisk*/
.req{
color:red;font-weight:bold;font-size:1.2em;
}
Results :
before :
after :
Hope this helps !