Copy link to clipboard
Copied
Hello all,
I'm working on a website and have a question on a specific page:
http://tullystattoo.businesscatalyst.com/raleigh-tattoo-portfolio
My question is: does anyone know a way to clear the 'Keywords' form input field after one submits the search form? For example, if I type in a word like 'color' into the keyword and hit the search button, I am presented with portfolio pieces that include 'color' in the description. However, 'color' still remains in the keyword form input field, so if I decide that I'd like to select the checkbox for 'grayscale' and search by 'technique' rather than 'keyword', the word color still remains in the input field. Dies anyone have any ideas on how I might be able to clear that form field each time a search is performed?
Thank you all in advance - you guys and gals are always great!
I have found an example of a site that has accomplished this found here: http://planmyplay.co.nz/ but I have no idea how they're doing it?
Hey,
This 'should' work.
You need to insert some javascript/jQuery into you scripts.js file
on one of the blank lines before //Flex slider init
you need to insert:
if (jQuery('.webappsearchresults')[0]) {jQuery('#CAT_txtKeywords').val("")}
Essentially it checks to see if there are search results on the page and then clears the value of the search box.
I don't guarantee this will work but I'm pretty confident, you may have to play around with it a bit.
Cheers
Pat
Copy link to clipboard
Copied
Hey,
This 'should' work.
You need to insert some javascript/jQuery into you scripts.js file
on one of the blank lines before //Flex slider init
you need to insert:
if (jQuery('.webappsearchresults')[0]) {jQuery('#CAT_txtKeywords').val("")}
Essentially it checks to see if there are search results on the page and then clears the value of the search box.
I don't guarantee this will work but I'm pretty confident, you may have to play around with it a bit.
Cheers
Pat
Copy link to clipboard
Copied
Formated your post Pat so it looks better. Was really hard to read
Copy link to clipboard
Copied
You guys are awesome - this worked perfectly. Thank you Pat and Liam!