Forums

reset search field

tvdgreft 27 Feb, 2016
I add a search field in List display - table:
<b>zoek</b> <input type="text" name="srch" />

I want to reset the search field after each search. Is that possible?
tvdgreft 29 Feb, 2016
I have read that, but I don't see how to reset the search key after a search.
GreyHead 29 Feb, 2016
Hi tvdgreft,

Please try adding this to the Header box of the listing -
<script type='text/javascript' >jQuery(document).ready(function(jQ){
  jQ('#srch').val('');
});
</script>
and edit the search box to add an id
<b>zoek</b> <input type="text" name="srch" id="srch" />

Bob

[[> later : corrected 'form' to 'listing' & added <script> tags <<]]
angelmorales 02 Mar, 2016
Can you tell me where is the "Header Box" , of the form??? I seek in my chronoform but I dont now where to put the code.

Thanks
angelmorales 02 Mar, 2016
I have a CC conected with CF , i have a search box , when I search data , submit the form, it displays the list again but I want that the search box its reset, how can I do this??
I try tu put this in the CC-Front List-List Display-Table:
<input type="text" name="srch" value="" autocomplete="off" autofocus>
<input type="submit" name="submit" value="Buscar"/>

But it doesnt work
Thanks for your help
GreyHead 03 Mar, 2016
Hi,

I meant to say the Header box of the listing - as that is where the search form is displayed.

Bob
angelmorales 03 Mar, 2016
I put the code like this ;

<b>zoek</b> <input type="text" name="srch" id="srch" />
jQuery(document).ready(function(jQ){
  jQ('#srch').val('');
});


But after each search,search field doesnt get reset.

Thanks
GreyHead 03 Mar, 2016
1 Likes
Hi,

You need to add the <script></script> tags too - I added them to my example.

Bob
This topic is locked and no more replies can be posted.