Between Issues Fixes : ps

This commit is contained in:
VE10-Sanjeev 2023-12-06 10:01:09 +05:30
parent 6bd45d798b
commit ae00cb6e76

View File

@ -480,21 +480,22 @@ function FieldChange(selectElement, rowCounter) {
var inputId = 'values' + rowCounter;
var column = $("#column"+rowCounter).find(':selected').attr('fieldflag');
if (column == 2 && (selectedOperator == 'greater than' || selectedOperator == 'greater than or equal to' || selectedOperator == 'less than' || selectedOperator == 'less than or equal to')) {
$('#' + inputId).replaceWith('<input type="date" class="form-control" id="' + inputId + '" name="values[]" placeholder="Enter the Date" />');
}else if(column == 2 && selectedOperator === 'between') {
var inputHtml = '<div style="display: inline-flex;"><input type="date" class="form-control" id="' + inputId + '1" placeholder="Enter the Start Date" onchange="concatBetween(' + rowCounter + ')" />' +
'<input type="date" class="form-control ml-1" id="' + inputId + '2" placeholder="Enter the End Date" onchange="concatBetween(' + rowCounter + ')" /></div>'+
'<input type="hidden" class="form-control" id="' + inputId + '" name="values[]" placeholder="values" />';
$('#' + inputId).replaceWith(inputHtml);
$('#' + inputId).parent().html('<input type="date" class="form-control" id="' + inputId + '" name="values[]" placeholder="Enter the Date" />');
}else if (column == 2 && selectedOperator === 'between') {
var newInput = '<div style="display: inline-flex;"><input type="date" class="form-control" id="' + inputId + '1" placeholder="Enter the Start Date" onchange="concatBetween(' + rowCounter + ')" />' +
'<input type="date" class="form-control ml-1" id="' + inputId + '2" placeholder="Enter the End Date" onchange="concatBetween(' + rowCounter + ')" /></div>' +
'<input type="hidden" class="form-control" id="' + inputId + '" name="values[]" placeholder="values" />';
$('#' + inputId).parent().html(newInput);
}
else if(column == 1 && (selectedOperator === 'contain' || selectedOperator == 'not contain')) {
$('#' + inputId).replaceWith('<input type="text" class="form-control" id="' + inputId + '" name="values[]" placeholder="Enter the Multiple Values with comma Seprator" onkeypress="return restriction(event,2)" />');
// $('#' + inputId).replaceWith('<input type="text" class="form-control" id="' + inputId + '" name="values[]" placeholder="Enter the Multiple Values with comma Seprator" onkeypress="return restriction(event,2)" />');
$('#' + inputId).parent().html('<input type="text" class="form-control" id="' + inputId + '" name="values[]" placeholder="Enter the Multiple Values with comma Seprator" onkeypress="return restriction(event,2)" />');
}else if(selectedOperator === 'is null' || selectedOperator == 'is not null') {
$('#' + inputId).replaceWith('<input type="hidden" class="form-control" id="' + inputId + '" name="values[]" placeholder="Enter the Values" value="0" />');
$('#' + inputId).parent().html('<input type="hidden" class="form-control" id="' + inputId + '" name="values[]" placeholder="Enter the Values" value="0" />');
}else if(column == 3 && (selectedOperator === 'equal' || selectedOperator == 'not equal' || selectedOperator == 'like' )){
$('#' + inputId).replaceWith('<select class="form-control" id="' + inputId + '" name="values[]" ><option value="">Choose the mode</option><option value="Online">Online</option><option value="Offline">Offline</option></select>');
$('#' + inputId).parent().html('<select class="form-control" id="' + inputId + '" name="values[]" ><option value="">Choose the mode</option><option value="Online">Online</option><option value="Offline">Offline</option></select>');
}else{
$('#' + inputId).replaceWith('<input type="text" class="form-control" id="' + inputId + '" name="values[]" placeholder="Enter the Values" onkeypress="return restriction(event,1)" />');
$('#' + inputId).parent().html('<input type="text" class="form-control" id="' + inputId + '" name="values[]" placeholder="Enter the Values" onkeypress="return restriction(event,1)" />');
}
}