Auto Search by selecting the date

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
Bishu
User
Posts: 429

Auto Search by selecting the date

Post by Bishu »

I am using the extension search with 1 field only.
and the field is Date field use the "Use date/time picker"

When I select the date from the date/time picker it should automatically search the list without clicking the search button.


mobhar
User
Posts: 11729

Post by mobhar »

Use jQuery in "Startup Script" to trigger "change" event of the field, and then execute the submit button on that search form. You need to inspect the element id/class before.


Bishu
User
Posts: 429

Post by Bishu »

I try using this code at "Startup Script"

$('.x_rdate').change(function(){
$('#btn-submit').submit();
});

it is not working


mobhar
User
Posts: 11729

Post by mobhar »

Bishu wrote:
$('#btn-submit').submit();

Wrong selector; it should be form id, not button id.


Bishu
User
Posts: 429

Post by Bishu »

thanks mobar
it working by code -
$('#x_rdate').change(function(){
$('#facstatementlistsrch').submit();
});

but the submit hit only we put manually at the search text box.
i want to hit the submit by selecting the date from the pick date/time


mobhar
User
Posts: 11729

Post by mobhar »

Simply change this code:
$('#x_rdate').change(function(){

to:
$('#x_rdate').on('change, blur', function(){


Bishu
User
Posts: 429

Post by Bishu »

now the code change to
$('#x_rdate').on('change,blur', function(){
$('#facstatementlistsrch').submit();
});

but it is not working


mobhar
User
Posts: 11729

Post by mobhar »

Bishu wrote:
$('#x_rdate').on('change,blur', function(){

Wrong syntax, you need to provide space after comma as I mentioned before (see below).

mobhar wrote:
$('#x_rdate').on('change, blur', function(){


Bishu
User
Posts: 429

Post by Bishu »

Thanks. It working fine


Post Reply