Skip to content

Commit

Permalink
Add html5 required attribute to field to checkout fields with pmpro_r…
Browse files Browse the repository at this point in the history
…equired class for accessibility and checkout experience improvement
  • Loading branch information
kimcoleman committed Jun 12, 2023
1 parent 7d68aa2 commit 4d7fdf5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions js/pmpro-checkout.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ jQuery(document).ready(function(){
//add required to required fields
if ( ! jQuery( '.pmpro_required' ).next().hasClass( "pmpro_asterisk" ) ) {
jQuery( '.pmpro_required' ).closest( '.pmpro_checkout-field' ).append( '<span class="pmpro_asterisk"> <abbr title="Required Field">*</abbr></span>' );
jQuery( '.pmpro_required' ).attr( 'required', 'required' );
}

//Loop through all radio type fields and move the asterisk.
Expand Down

0 comments on commit 4d7fdf5

Please sign in to comment.