• Resolved andrewgentle

    (@andrewgentle)


    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.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter andrewgentle

    (@andrewgentle)

    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

    Thread Starter andrewgentle

    (@andrewgentle)

    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.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘<form> tag stripping’ is closed to new replies.