Check box

General ShopSite user discussion

Check box

Postby malljess » Tue Dec 13, 2011 5:10 am

I am still working on the search results page. I am trying different things but hitting roadblocks.

That being said .....

Is it possible to create check boxes that if checked, certain search criteria is included in the search. More specifically can a IF statement be used to run script that returns results based on certain criteria. For example, if a check box is checked, the criteria will use ebook in the search term. Al I need to really know is 1) how to create check box in search form 2) If an IF statement can be run if the check box is true.

Hope I am clear.

Thanks.
malljess
 
Posts: 50
Joined: Sat Oct 22, 2011 7:38 am

Re: Check box

Postby Jim » Tue Dec 13, 2011 1:46 pm

1. A checkbox is an html form element, so yes you could put one in a search form since that is also an html form. See http://www.w3schools.com/html/html_forms.asp for how to format the checkbox.

Search results pages are generated on the fly so you could possibly set a ShopSite template tag VAR using javascript to check the value of the checkbox and set the VAR before the form is submitted. Base on your VAR the IF could then execute different blocks of code.
This would not be possible on regular store pages that are static html and thus there are no template tags in the page. However, you might be able to still do something but it would have to all be in javascript.

Note: I'm not a javascript programmer so can't tell you exactly how to do it.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah


Return to User Forum

Who is online

Users browsing this forum: No registered users and 121 guests