You need to edit two files in order to complete the new “required” fields to get working. First file is speakout/includes/emailpetition.php and the second file is speakout/js/public.js
The first file “emailpetition.php”
The following steps are required in order to make the relevant to “required”.
Find the following line.
<label for=”dk-speakout-postcode-‘ . $petition->id . ‘”>’ . __( ‘Post Code’, ‘dk_speakout’ ) . ‘</label>
Change this line to;
<label for=”dk-speakout-postcode-‘ . $petition->id . ‘” class=”required”‘ . ‘>’ . __( ‘Post Code’, ‘dk_speakout’ ) . ‘</label>
The second file public.js
Find the following lines:
if ( lastname === ” ) {
$( ‘#dk-speakout-last-name-‘ + id ).addClass( ‘dk-speakout-error’ );
errors ++;
}
Append just after this if statement section the following if statement.
if ( postcode === ” ) {
$( ‘#dk-speakout-postcode-‘ + id ).addClass( ‘dk-speakout-error’ );
errors ++;
}
So it should look like this:
if ( lastname === ” ) {
$( ‘#dk-speakout-last-name-‘ + id ).addClass( ‘dk-speakout-error’ );
errors ++;
}
if ( postcode === ” ) {
$( ‘#dk-speakout-postcode-‘ + id ).addClass( ‘dk-speakout-error’ );
errors ++;
}