开发者

I'm getting 0 results in my search whenever i have the search input area prefilled

I'm having trouble getting search results in my form whenever I use js to pre-fill the input field.开发者_运维知识库 I was wondering if their was a workaround this.

I'm using this code -

value="Keywords" onfocus="if (this.value == 'Keywords') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Keywords';}" />

thanks!


Whatever this issue is, it is related to some other code that you have not yet shared with us (without seeing how you're processing the form, we can only speculate what might be causing the problem).

Below is a jsFiddle example that shows that the code you posted works perfectly. This is only proof that something else in your code is causing the error. http://jsfiddle.net/pULAS/

I would recommend taking a good hard look at the server side code you're using to read and process the form, as the culprit is likely in there.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜