
Runner.pages.PageSettings.addPageEvent('pro_registro',Runner.pages.constants.PAGE_ADD,"afterPageReady",function(pageObj,proxy,pageid,inlineRow,inlineObject,row){function validarValor(ctrl){pvolumen=ctrl.getValue();$.ajax({type:'POST',url:'./valida_valor.php',data:{volumen:pvolumen}}).done(function(msg){msgArr=msg.split(";");if(msgArr[0]=='1'){$("#ajax_custom_valor").text('');}else{$("#ajax_custom_valor").text(msgArr[2]);ctrl.setValue("");}}).fail(function(jqXHR,textStatus,errorThrown){alert("The following error occured: "+textStatus+" "+errorThrown);});}
var ctrlvalor=Runner.getControl(pageid,'volumen');var ctrltext=Runner.getControl(pageid,'test');$('[data-helpfor="valor"]').append('<strong class="help-block" style="color:red";><div id="ajax_custom_valor"></div></strong>');ctrlvalor.on('change',function(e){validarValor(ctrlvalor);});this.on('beforeSave',function(formObj,fieldControlsArr,pageObj){if(ctrlvalor.getValue()!=''){return true;}else{$("#ajax_custom_valor").text('The "Valor" field must be informed');Runner.delDisabledClass(pageObj.saveButton);return false;}});;});Runner.pages.PageSettings.addPageEvent('pro_registro',Runner.pages.constants.PAGE_EDIT,"afterPageReady",function(pageObj,proxy,pageid,inlineRow,inlineObject,row){function validarValor(ctrl){pvolumen=ctrl.getValue();$.ajax({type:'POST',url:'./valida_valor.php',data:{volumen:pvolumen}}).done(function(msg){msgArr=msg.split(";");if(msgArr[0]=='1'){$("#ajax_custom_valor").text('');}else{$("#ajax_custom_valor").text(msgArr[2]);ctrl.setValue("");}}).fail(function(jqXHR,textStatus,errorThrown){alert("The following error occured: "+textStatus+" "+errorThrown);});}
var ctrlvalor=Runner.getControl(pageid,'volumen');var ctrltext=Runner.getControl(pageid,'test');$('[data-helpfor="valor"]').append('<strong class="help-block" style="color:red";><div id="ajax_custom_valor"></div></strong>');ctrlvalor.on('change',function(e){validarValor(ctrlvalor);});this.on('beforeSave',function(formObj,fieldControlsArr,pageObj){if(ctrlvalor.getValue()!=''){return true;}else{$("#ajax_custom_valor").text('The "Valor" field must be informed');Runner.delDisabledClass(pageObj.saveButton);return false;}});;});