Search Results

Search found 1 results on 1 pages for 'pman'.

Page 1/1 | 1 

  • focus() jQuery function doesn't work in Safari, but works fine on all other browsers?

    - by pMan
    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..

    Read the article

1