Support » Plugin: WP Survey And Quiz Tool » Poll bug when validating required fields

  • Resolved ered15

    (@ered15)


    Hi, i download this plugin and its nice, but i was struggling with a bug when i created a POLL, i found that when the user doesn’t select any option and submits the FORM the code validates the Questions that are required and the titles of the Questions that weren’t answered should turn red instead some do and some don’t, so i found the solution for this hope it helps someone with the same problem:

    REPLACE LINE 34 of the file \pages\site\poll\section.php

    FROM:
    if ( empty($_SESSION['wpsqt']['current_message']) || in_array($questionId,$_SESSION['wpsqt']['required']) ){

    TO:
    if ( empty($_SESSION['wpsqt']['current_message']) || $givenAnswer[0]!='' ){

    REPLACE LINE 42 of the file \pages\site\poll\section.php

    FROM:
    if ( !empty($_SESSION['wpsqt']['current_message']) && !in_array($questionId,$_SESSION['wpsqt']['required']) ){

    TO:
    if ( !empty($_SESSION['wpsqt']['current_message']) && $givenAnswer[0]=='' ){

    @ered15

    http://wordpress.org/extend/plugins/wp-survey-and-quiz-tool/

  • The topic ‘Poll bug when validating required fields’ is closed to new replies.