WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] <form> tag stripping (3 posts)

  1. AndrewGentle
    Member
    Posted 5 years ago #

    Hi,

    I am using the following HTML to place a search form on my WordPress blog:

    <form method="get" id="andrew" action="/search/">	<input class="searchbox" type="text" value="Search" onfocus="clearMe(this)" name="s" id="s" />
    	<input type="submit" id="searchsubmitx" value="Search" />
    	</form>
    </form>

    The problem is that when I view the 'generated HTML' (after the JavaScript is finished messing with it), the <form method="get... > tag is replaced by <form>. This means that instead of going to url.com/search/?s=<search string>, the form just adds the ?s=<search string> on to the end of the URL of the page from which the search was performed. What could be stripping off my form arguments and how can I stop it from doing so?

    Interestingly, when I use Exec-PHP to insert the same code into a post, the <form> tag is not stripped and the form works perfectly.

  2. AndrewGentle
    Member
    Posted 5 years ago #

    If anyone knows what is going on here it would be much appreciated. All I have is a <form ... tag in my theme for searching the page and something is stripping off its arguments so that it is interpreted by the browser as <form>

    Any ideas?
    Thanks
    -Andrew

  3. AndrewGentle
    Member
    Posted 5 years ago #

    This has now been resolved, it turned out to be my fault!
    I'd managed to nest my form tag within another, blank form tag. The browser then ignored the inner tag.

Topic Closed

This topic has been closed to new replies.

About this Topic