If a custom search form in WebLink has a DatePicker option, whenever the user presses enter, the date picker pops up.
Ideally, we'd like this to submit the form and allow the null value to go through just as if the user clicked on the Submit button.
If a custom search form in WebLink has a DatePicker option, whenever the user presses enter, the date picker pops up.
Ideally, we'd like this to submit the form and allow the null value to go through just as if the user clicked on the Submit button.
Appreciate the idea Wes!
I expanded on it to add the desired behavior. Now when users press enter, they will submit the search instead of pop-up the date picker.
<script type="text/javascript">
$('#form1').keypress(function(e){
if (e.keyCode == 10 || e.keyCode == 13)
{
e.preventDefault();
$('input[type="submit"]').click();
}
});
</script>
In the meantime you can override the "Enter" key issue by opening up "CustomSearch.aspx" and adding the following code right above the "</body>" tag:
<script type="text/javascript">
$('#form1').keypress(function(e){
if (e.keyCode == 10 || e.keyCode == 13)
e.preventDefault();
});
</script>
Save the file and then reload the page.
We have a client frustrated by this as well...
Thanks for reporting this. We have this issue noted in our system and will update the thread when a resolution is available.
Thanks for script Wes & Carl. I was able to make use of this for my customer. +1 to the list of people who would like to have this as a built-in feature.
Hi there,
I have several search forms and I want to know whether I should replace 'form1' from your code to my search form name.
Also, when I pressed 'Enter', the field input are being cleared.
Thanks to advise.
Will WebLink 10 be updated to make the submit button the default and not the date picker button?