You need to sign in to do that
Don't have an account?
Need Help completing custom search functionality
I am working on a visualforce page that provides a search field and returns the results on the same page. I have two problems with the search field.
1. The search box can only be used once for each time the page loads. How do I change this to allow the user keep using the same page without manually refreshing the entire page? I have not found any discussions on this, so I don't have code to post that is not working.
2. The second question I have does have some code that I have started. I am trying to program the search field allow the user hit enter on the keyboard to search rather than having to click the search button. Here is my Javascript:
button:
<apex:commandButton value="Search" action="{!Search}" rerender="table"/>
javascript:
<script> function noenter(ev) { if (window.event && window.event.keyCode == 13 || ev.which == 13) { Search(); return false; } else { return true; } } </script>
What do I need to change for this to work?
Thanks
The good news is that this definitely can work, as I've used this for a number of clients.
Why can the search box only be used once? As you are re-rendereding via your command button, presumably the user can fill in different information and click it again? Or is there something here I'm missing.
The javascript looks reasonable, however we need to see what Search() does and also how its liked in to the input field.
Can you post the whole page?
There is no reason why the user shouldn't be allowed to run more than one search, and I would like to allow that. Here is the visualforce page code:
and the class:
Thanks