add focusout constraint
This commit is contained in:
parent
7f6e4886fc
commit
62d007e232
@ -679,10 +679,13 @@ if (!empty($usemargins) && $user->rights->margins->creer) {
|
|||||||
<?php if ($this->table_element_line != 'commande_fournisseurdet' || $this->table_element_line == 'facture_fourn_det') { ?>
|
<?php if ($this->table_element_line != 'commande_fournisseurdet' || $this->table_element_line == 'facture_fourn_det') { ?>
|
||||||
$("#date_start, #date_end").focusout(function()
|
$("#date_start, #date_end").focusout(function()
|
||||||
{
|
{
|
||||||
if ( $(this).val() == '' && !$(this).hasClass("error") ) {
|
type = $(this).attr('type');
|
||||||
$(this).addClass('error');
|
if (type == 1){
|
||||||
}else{
|
if ( $(this).val() == '' && !$(this).hasClass("error") ) {
|
||||||
$(this).removeClass('error');
|
$(this).addClass('error');
|
||||||
|
}else{
|
||||||
|
$(this).removeClass('error');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
@ -714,6 +717,11 @@ if (!empty($usemargins) && $user->rights->margins->creer) {
|
|||||||
function(data) {
|
function(data) {
|
||||||
console.log("Load unit price end, we got value "+data.price_ht);
|
console.log("Load unit price end, we got value "+data.price_ht);
|
||||||
|
|
||||||
|
$( '#date_start').removeAttr( "type" );
|
||||||
|
$( '#date_end' ).removeAttr( "type" );
|
||||||
|
$('#date_start').attr('type', data.type);
|
||||||
|
$('#date_end').attr('type', data.type);
|
||||||
|
|
||||||
// service and we setted mandatory_period to true
|
// service and we setted mandatory_period to true
|
||||||
if (data.mandatory_period == 1 && data.type == 1 ) {
|
if (data.mandatory_period == 1 && data.type == 1 ) {
|
||||||
jQuery("#date_start").addClass("error");
|
jQuery("#date_start").addClass("error");
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user