Auto clean search field to avoid to have 2 conflict search criteria
This commit is contained in:
parent
513ef1e727
commit
c62d147c60
@ -333,7 +333,7 @@ if ($result)
|
||||
if ($accounting_product_mode == 'ACCOUNTANCY_BUY') print '<td class="liste_titre"></td>';
|
||||
// Current account
|
||||
print '<td class="liste_titre">';
|
||||
print '<input type="text" class="flat" size="6" name="search_current_account" value="' . dol_escape_htmltag($search_current_account) . '">';
|
||||
print '<input type="text" class="flat" size="6" name="search_current_account" id="search_current_account" value="' . dol_escape_htmltag($search_current_account) . '">';
|
||||
$listofvals=array('withoutvalidaccount'=>$langs->trans("WithoutValidAccount"), 'withvalidaccount'=>$langs->trans("WithValidAccount"));
|
||||
print ' '.$langs->trans("or").' '.$form->selectarray('search_current_account_valid', $listofvals, $search_current_account_valid, 1);
|
||||
print '</td>';
|
||||
@ -481,6 +481,14 @@ if ($result)
|
||||
});
|
||||
|
||||
init_savebutton();
|
||||
|
||||
jQuery("#search_current_account").keyup(function() {
|
||||
if (jQuery("#search_current_account").val() != \'\')
|
||||
{
|
||||
console.log("We set a value of account to search "+jQuery("#search_current_account").val()+", so we disable the other search criteria on account");
|
||||
jQuery("#search_current_account_valid").val(-1);
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>';
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user