This topic is locked
[SOLVED]

 validate in real time in a list

12/26/2018 10:27:41 AM
PHPRunner General questions
A
ayctech author

Can you validate that the articles are not repeated from the view? For example, if we choose an article and when you click on Add New, that article will no longer appear

Sergey Kornilov admin 12/26/2018

You cannot do this. These items are not even saved in the database.
Probably the best you can do is to implement BeforeAdd event of details table and check if such an item exists already preventing it from being saved.

A
ayctech author 12/27/2018

I have the following problem when validating in detail. When saving, it already records the header in the database and then validates the detail.

A
ayctech author 12/27/2018

I made a logic with jquery and it works, anyway I would like to know how to validate in detail before I save the header
this.on('beforeSave', function(formObj, fieldControlsArr, pageObj){
var add=0;

$('select[name^=value_id_articulo] option:selected').each(function() {
if (add==0) {
add = $(this).text();
}else if ($(this).text()== add){

alert ("El articulo "+$(this).text()+" ya fue añadido en la lista");

}

})
});