WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] input type="hidden" validation problem (9 posts)

  1. vkaryl
    Member
    Posted 7 years ago #

    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....]

  2. moshu
    Member
    Posted 7 years ago #

    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?

  3. vkaryl
    Member
    Posted 7 years ago #

    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>

  4. moshu
    Member
    Posted 7 years ago #

    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>

  5. vkaryl
    Member
    Posted 7 years ago #

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

  6. pizdin_dim
    Member
    Posted 7 years ago #

    "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.

  7. vkaryl
    Member
    Posted 7 years ago #

    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!

  8. pizdin_dim
    Member
    Posted 7 years ago #

    Try this:

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

  9. vkaryl
    Member
    Posted 7 years ago #

    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!]

Topic Closed

This topic has been closed to new replies.

About this Topic