Page 1 of 1

Styling the Search Function

Posted: Tue May 29, 2007 2:44 pm
by deejmer
I am trying to build a custom search form for a website, so am trying to alter the default "Search Template" in the admin panel.  The code I'm trying to use is:

Code: Select all

{$startform}
<img src="images/holohanCustom/search1.gif" align="bottom"> 
<input type="text" name="cntnt01searchinput" id="cntnt01searchinput" class="custom" size="15" align="bottom"/>
<input name="cntnt01submit" value="GO" class="customSubmit" type="submit" />   {$hidden}
{$endform}
Now, because I'm not using the default smarty tags, and trying to use custom text field inputs and search buttons, the search function doesn't actually work anymore.  I just get this text returned after submitting the query:
Search Results For ""  No Results Found!
So it seems that it is triggering the action, but nothing is passed?  I have a feeling that

Code: Select all

name="cntnt01searchinput" id="cntnt01searchinput"
might be incorrect, but I found these on other messageboard topics.  Does anyone know what I've done wrong?

Re: Styling the Search Function

Posted: Tue May 29, 2007 3:48 pm
by alby
deejmer wrote: I am trying to build a custom search form for a website, so am trying to alter the default "Search Template" in the admin panel.  The code I'm trying to use is:

Code: Select all

{$startform}
<img src="images/holohanCustom/search1.gif" align="bottom"> 
<input type="text" name="cntnt01searchinput" id="cntnt01searchinput" class="custom" size="15" align="bottom"/>
<input name="cntnt01submit" value="GO" class="customSubmit" type="submit" />   {$hidden}
{$endform}
Missing code (maybe {$hidden}  ???).
Insert default tag {search} and look all output html code.
My output is:

Code: Select all


<form id="m5moduleform_1" name="m5moduleform_1" method="get" action="index.php">
<div class="hidden">
<input type="hidden" name="mact" value="Search,m5,dosearch,0" />
<input type="hidden" name="m5returnid" value="22" />
</div>

<fieldset>Ricerca sul sito<br />
<input type="hidden" name="m5origreturnid" value="1" />

<input type="text" name="m5searchinput" id="m5searchinput" value="" size="20" maxlength="50" onfocus="if(this.value==this.defaultValue) this.value='';" onblur="if(this.value=='') this.value=this.defaultValue;" />
<input type="submit" id="submit" class="invia" value="Cerca" />
</fieldset>
</form>
Alby

Re: Styling the Search Function [SOLVED]

Posted: Tue May 29, 2007 3:57 pm
by deejmer
I had the {$hidden} tag in there...that wasn't the problem.  The problem was (as I thought)...

Code: Select all

name="cntnt01searchinput" id="cntnt01searchinput"
I just viewed the output after a search as per your recomendation and changed the name and id to match the identifier in the output.  and now....IT WORKS!

Thanks so much!