Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

plumsail on change event value

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;
  }
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: i in javascript 
Javascript :: terraform for loop json 
Javascript :: react onwheel preventDefault 
Javascript :: (state.isLoggedIn = function() {return false}) react redux 
Javascript :: getderivedfromstate alternative 
Javascript :: js 2 varibale points on same values 
Javascript :: javascript folder array randomizer 
Javascript :: javascript array includes time complexity 
Javascript :: javascript Why is this function working on second click only 
Javascript :: hide navbar and footer on certain pages like dashboard. react-router 
Javascript :: angularjs GetVideos API, Cant get the key parameter inside the array 
Javascript :: Changing the value of a dropdown when the value of a number box changes in AngularJS 
Javascript :: js read html file 
Javascript :: Easy Angular way to detect if element is in viewport on scroll 
Javascript :: how to use recursive function to select the parent in a tree array using angulat ui tree 
Javascript :: Display all posts from database 
Javascript :: How to hover over data inserted from JSON 
Javascript :: reverse array without using another array 
Javascript :: How to limit properties of a JSON object given array of property names using JQ 
Javascript :: Javascript if time is between 7pm and 7am do this? Javascript If Statement Time Action 
Javascript :: react native push notifications cancel delivered notification 
Javascript :: “Line Splicing in C++” 
Javascript :: phaser reverse matrix columns 
Javascript :: Simple Cryptocurrency Blockchain Using JavaScript 
Javascript :: Self Invoking Function Tip 
Javascript :: Set Up Model In MongoDB 
Javascript :: Declare Function To Be Used In Class 
Javascript :: check if can go back react native 
Javascript :: load limited data and search data from all in angularjs 
Javascript :: How to Loop Through an Array with a forEach Loop in JavaScript 
ADD CONTENT
Topic
Content
Source link
Name
4+6 =