WordPress.org

Forums

WP Survey And Quiz Tool
[resolved] Poll bug when validating required fields (1 post)

  1. ered15
    Member
    Posted 1 year ago #

    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/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.