WordPress.org

Ready to get started?Download WordPress

Forums

Surveys
Extra radio button and box after each answer (1 post)

  1. krishnan.n
    Member
    Posted 1 year ago #

    Hi,

    Modified the piece of code below to remove the extra radio button.

    Can you pl explain what this piece is doing?

    show_survey.php, line 131 onwards

    if($ques->allow_user_answer)  {
        echo "<input type='$type' name='answer-{$ques->ID}[]' id='answer-id-{$ans->ID}' class='answer' value='user-answer' />\n";
    
        if($ques->user_answer_format == 'textarea')
          echo "<textarea name='user-answer-{$ques->ID}' rows='5' cols='30' class='user-answer'></textarea>";
        elseif($ques->user_answer_format == 'checkbox')
           echo "<input type='checkbox' name='user-answer-{$ques->ID}' class='user-answer' value='1' />";
        else
          echo "<input type='text' name='user-answer-{$ques->ID}' class='user-answer' value='' />";
      }

    The modification is in the top if statement:
    if($ques->allow_user_answer && $type != 'radio')

    Not sure if this is going to cause problems elsewhere, though.

    http://wordpress.org/extend/plugins/surveys/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic