Support » Plugin: SS Quiz » Validation error

  • Resolved johanna2patricia

    (@johanna2patricia)


    Hi,
    I try to validate my site, but I get this error:”The for attribute of the label element must refer to a form control.”
    I understand that there probably is an id missing, but I have no clue where to change that.
    I get it for the name and email input, because I am using those.
    “<label for=”user_name”>Name: </label><input type=”text” id=”ssuser_name” nam…”
    Can somebody help?

    Johanna

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

Viewing 1 replies (of 1 total)
  • Ok I figured it out.
    The user_name and the id must have the same name.
    the same goes for the ssemail.
    So I changed that in the client-side.php and also in the quiz.js. Now everything is working fine and validates.
    This is the new code for the client-side.php :

    echo '<label for="user_name">'.__("Name", 'ssquiz').': </label>';
    echo '<input type="text" id="user_name" name="user_name" value="" />';
    echo '<br />';
                                        }
    if(get_transient("email".$session)) {
    echo '<label for="email">'.__("E-Mail", 'ssquiz').': </label> ';
    echo '<input type="text"  id="email" name="email" value="" />';
    			}

    And in the quiz.js just change all the ssuser_name to: user_name and ssemail to: email

    Johanna

Viewing 1 replies (of 1 total)
  • The topic ‘Validation error’ is closed to new replies.