WordPress.org

Support

Support » Plugins and Hacks » [Resolved] input type=”hidden” validation problem

[Resolved] input type=”hidden” validation problem

  • vkaryl
    Member

    @vkaryl

    I’m using a rework of the Relaxed 1.0 theme by DL2 Media on one of my client sites. I’ve widgetized the theme, and it’s now throwing this error in the http://validator.w3.org/ routine:

    Error Line 54 column 168: document type does not allow element “input” here; missing one of “ins”, “del”, “h1”, “h2”, “h3”, “h4”, “h5”, “h6”, “p”, “div”, “address”, “fieldset” start-tag.

    ...="98e3add0e67e37aa0849ddb9662cac78" />.

    Viewing the source of the error shows this:

    <form method="get" id="searchform" action="http://clientsite.org/wordpress/"><input type="hidden" name="PHPSESSID" value="ea3e57cb9fa1b4d4a54b3ca546aef2ea" />

    I have gone through every file in the entire wordpress installation. I can’t find where this particular input is getting added. I can see that probably the input is hidden to keep the PHPSESSID from erroring out, but not having the input enclosed in either a div or p tagset is causing the other error I’m getting.

    Anyone have any idea where this is set up in wp? At this point I’m assuming it must be in the core files. [Oh – btw, I’ve actually widgetized my own preferred searchform setup, but it was throwing this error with the in-built search widget too – in fact, that was why I widgetized my search to begin with, but obviously it didn’t help….]

Viewing 8 replies - 1 through 8 (of 8 total)
  • moshu
    Member

    @moshu

    Does it have to have that session thing? In other themes the searchform doesn’t have it and it still works…
    What happens if you delete that whole line?

    vkaryl
    Member

    @vkaryl

    That’s the problem: the line isn’t there in the searchform. This is the entire content of the searchform.php file:

    <form method="get" id="searchform" action="<?php bloginfo('home'); ?>/">
    <div>
    <input type="text" value="<?php echo wp_specialchars($s, 1); ?>" name="s" id="s" />
    <input type="submit" id="searchsubmit" value="Search" />
    </div>
    </form>

    moshu
    Member

    @moshu

    Mine is like this:
    <form method="get" id="searchform" action="<?php echo $_SERVER['PHP_SELF']; ?>">
    <div><input type="text" value="<?php echo wp_specialchars($s, 1); ?>" name="s" id="s" />
    <input type="submit" id="searchsubmit" value="Search" />
    </div>
    </form>

    vkaryl
    Member

    @vkaryl

    Yup, tried that one too. I guess you’re not getting a validation error, huh?

    Pizdin Dim
    Member

    @pizdin_dim

    “I can’t find where this particular input is getting added.”

    I believe PHP generates that when the cookies are disabled according to your php.ini file. Check the values of “session.use_cookies”, “session.use_only_cookies” and “session.use_trans_sid”. I can’t check my configuration at the moment but I’d suggest the first two should be “1” and the last “0”.

    If you’re running in a shared hosting environment, an alternative could be to set those three variables in your own htaccess file instead.

    vkaryl
    Member

    @vkaryl

    I don’t have access to php.ini on this provider setup. How would I write this into .htaccess (being’s I’m not all that bright when it comes to that stuff, I hope you can help….)

    Thanks!

    Pizdin Dim
    Member

    @pizdin_dim

    Try this:

    php_value session.use_cookies 1
    php_value session.use_only_cookies 1
    php_value session.use_trans_sid 0

    vkaryl
    Member

    @vkaryl

    Okay, let me give that a shot…. thanks for your help.

    [Edit: REALLY thank you! That fixed it. I’m thinking it must be something with the provider on this domain, since I have this exact setup elsewhere with valid code, no problems at all. Bless you!]

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘[Resolved] input type=”hidden” validation problem’ is closed to new replies.