-
- 102 Posts
Antonio Zdilar
linearvector.com
-
- 102 Posts
Add this to your form:
<input type="text" name="[[+searchIndex]]" id="[[+searchIndex]]" onfocus="if(this.value=='Suche') this.value='';" onblur="if(this.value=='') this.value='Search';" value="Suche" />
<input type="hidden" name="id" value="[[+landing:default=[[*id]]]]" />
You have everything here:
http://rtfm.modx.com/display/ADDON/SimpleSearch.SimpleSearchForm.tpl
[ed. note: blankcheck last edited this post 12 years, 2 months ago.]
Antonio Zdilar
linearvector.com
-
- 102 Posts
Form body must be in searchform chunk. So:
Create searchform chunk
Place this in it:
<form id="searchform" action="[[~[[+landing:default=`[[*id]]`]]]]" method="[[+method:default=`get`]]">
<fieldset>
<input type="text" name="[[+searchIndex]]" id="[[+searchIndex]]" onfocus="if(this.value=='Suche') this.value='';" onblur="if(this.value=='') this.value='Search';" value="Suche" />
<input type="hidden" name="id" value="[[+landing:default=[[*id]]]]" />
<button type="submit"></button>
</fieldset>
</form>
In your template (where you want form to show) put
[[SimpleSearchForm? &tpl=`searchform` &landing=`11`]]
In template where the results will be shown put
Antonio Zdilar
linearvector.com
-
- 102 Posts
//remove id from form tag
<form action="[[~[[+landing:default=`[[*id]]`]]]]" method="[[+method:default=`get`]]">
<fieldset>
//add classes to inputs and style it as you wish
<input type="text" class="myClass" name="[[+searchIndex]]" id="[[+searchIndex]]" onfocus="if(this.value=='Suche') this.value='';" onblur="if(this.value=='') this.value='Search';" value="Suche" />
<input type="hidden" name="id" value="[[+landing:default=[[*id]]]]" />
<button type="submit"></button>
</fieldset>
</form>
Antonio Zdilar
linearvector.com