I have a search text field and search button, when button is clicked with default text in text field, or null value, an alert pops up and sets focus back on search text field. This works very well on all major browsers but not in safari.
I tried it even with out jquery, but didn't work. When the focus falls on search text field, I have another jQuery function, is that the problem.
The code that sets focus on search text is:
if (defaults.keyword == SEARCH_TIP || defaults.keyword == '') {
alert(SEARCH_NULL);
$('#store_search_keyword').focus();
return false;
}
The code on focus is:
var search_dom = $('#store_search_keyword');
var search_text = search_dom.val();
search_dom.focus(function(){
if ($(this).val() === SEARCH_TIP) {
$(this).val('');
}
});
any help is appreciated, thanks..