Categoryid in search form

Discussion in 'Templates, HTML, CSS, and Design Help' started by jason1971, Jun 10, 2014.

  1. jason1971 Customer

    Hi all,

    I have created a search form which works fine. But I would like to add an element in to it so that it only searches for listings with the particular category.

    This is the part of the form I am stuck on #

    {if $categoryname}<b>{$categoryname}</b> <input type="checkbox" name="type" value="{$categoryid==""}" checked /> {else} blah blah rest of form{/if}

    It does not seem to like the code in red above, any thoughts please ?

    Cheers Jason
  2. Mike-N-Tosh Owner

    {$categoryid==""} is a statement. You are saying, assign nothing to the variable catergoryid which makes no sense at all as a value to an input field. If you have the categoryid, then just make the value="{$categoryid}"
  3. jason1971 Customer

    Thanks Mike you sorted it as usual

Share This Page