Plumil o wartości zdarzenia zmiany

var saving;
fd.spRendered(function () {
  fd.toolbar.buttons[0].text = "Submit";

    //Item01 Change event
    fd.field('Item01').$on('change',function(value){
      if(!saving){
          var limitflag = 0;
          if (value >15 || value <0)
          {
            alert("Please enter a value between 1 and 15");
            limitflag = 1;
          }
         
          if (limitflag == 1)
          {
             //fd.field('Item01').value ='';
          }
          if( value == fd.field('Item02').value || value == fd.field('Item03').value || value == fd.field('Item04').value || value == fd.field('Item05').value || value == fd.field('Item06').value || value == fd.field('Item07').value || value == fd.field('Item08').value || value == fd.field('Item09').value || value == fd.field('Item10').value || value == fd.field('Item11').value || value == fd.field('Item12').value || value == fd.field('Item13').value || value == fd.field('Item14').value || value == fd.field('Item15').value)
          {
              alert("The value already entered for another field, please remove the existing ones to add this value");
              //fd.field('Item01').value ='';
          }
      }
      
    });//End of Item01 Change Event
    
    //Item02 Change event
    fd.field('Item02').$on('change',function(value){
      if(!saving){
          var limitflag = 0;
          if (value >15 || value <0)
          {
            alert("Please enter a value between 1 and 15");
            limitflag = 1;
          }
          if (limitflag == 1)
          {
          //fd.field('Item02').value ='';
          }
          if ( value == fd.field('Item01').value || value == fd.field('Item03').value || value == fd.field('Item04').value || value == fd.field('Item05').value || value == fd.field('Item06').value || value == fd.field('Item07').value || value == fd.field('Item08').value || value == fd.field('Item09').value || value == fd.field('Item10').value || value == fd.field('Item11').value || value == fd.field('Item12').value || value == fd.field('Item13').value || value == fd.field('Item14').value || value == fd.field('Item15').value)
          {
           alert("The value already entered for another field, please remove the existing ones to add this value");
          //fd.field('Item02').value ='';
          }
      }
    });//End of Item02 Change Event
});

fd.spBeforeSave(function(){
  if(fd.isValid){
    saving = true;
  }
});
Levent Acar