search form js optimization