• I am using the plugin – SpeakOut! Email Petitions – I need to make the zip code required and see no option for this. The client is a non-profit so I don’t want to charge them too much to tweek.

    Thank you

Viewing 3 replies - 1 through 3 (of 3 total)
  • 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 ++;
    }

    Thanks for that.

    I will add this to the FAQ. Maybe one day I will make it an option.

    Thread Starter LoisReed

    (@loisreed)

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘SpeakOut! Email Petitions, required field’ is closed to new replies.