开发者

special characters in name field for search

We are creating a quick find search field.

开发者_开发技巧

The html is like so:

<form>
                    <fieldset class="search">
                    <input class="contact-propid" type="text" name="" value="" placeholder="enter property id">
                    <button class="btn" title="Search"></button>

                    </fieldset>
                </form>

the expected search term is like : p-442749379

And the dest url looks like:

thissite.com/listing.php?id=p-442749379

Now this quick search is in the header of all pages.. And I see if I add : name="listing.php?id=" in the input class , it nearly gets me to where I want to go ...

Except the browser converts the ? and = and doesnt render these in the browser correctly

fiddle http://jsfiddle.net/ozzy/EdKpM/

oh and it puts a ? before listing


<form action="listing.php" method="GET">
     <input type="text" name="id" placeholder="enter property id">
     <input type="submit" value="Search">
</form>

Set an action and method on the <form> and a name on the <input> element and it'll do what you want.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜