Placeholder for search text field

I believe that anyone knows this placeholder behavior for search-text fields. When the page loads, it has a line in it, for example, โ€œsearch here ...โ€, and as soon as the user inserts the line into the text block, it appears again and it appears again if the user did not insert any information as soon as the user bounces this is a text box.

I am currently using jQuery Placeholder-Plugin to understand what's on my ASP.Net page.

I am raising questions, maybe the plugin does not support what I want, maybe it is, I donโ€™t know:

I will have an image in the text box instead of the line for the destination file. (Suppose TextBox is Google Search, and I want to have beautiful colored Google text instead of the boring, one-color "Google search here ..:").

Any ideas?

0
source share
2 answers

I wrote a plugin for this in jQuery, which I released here for a giggle: the jQuery Plugin page .

For some reason, I named it by default. This is because it uses the default dom value for the text field. Maybe this will help you?

+1
source

Try this Html : <input type="text" />

css : input{ background: url(http://profile.ak.fbcdn.net/hprofile-ak-prn1/71158_111108655596607_6920099_n.jpg) no-repeat left top }

Javascript : $('input:text').keyup(function (e) { $(this).css('background', 'none'); if($(this).val() == ""){ $(this).css('background', 'url(http://profile.ak.fbcdn.net/hprofile-ak-prn1/71158_111108655596607_6920099_n.jpg) no-repeat left top'); } }); I hope kovu works great.

+1
source

All Articles