0 Replies Latest reply on Jun 19, 2013 12:36 PM by crystaltroiano

    Help me check 2 fields and then show final number

    crystaltroiano

      I'm very new to JavaScript and need a little help with a function.

       

      I need to have JS check to make sure 'Equipment Description' and 'Equipment Serial' are filled out before showing a field named 'Incentive'. My hope is that if the fields are NOT filled out that it will then give an app.alert('Please enter an equipment serial number').

       

      I had originally started a different way and this was as far as I got if that helps anyone. (the first 2 lines are used because there are many rows of information that can be gathered - this was from a previous developer who is no longer on our team ) The issue is that they are seperate and I need it to check for both and obviously it doesn't tell the incentive field to do anything as far as visibility goes. I am file starting from scratch and not using this code.

       

      function getcheck() {
      var rowName = event.target.name;
      var rowNum = rowName.substr(rowName.length-5,5);
          
      if (this.getField("Equipment Description"+ rowNum).value == " ") {
           app.alert('Please enter an equipment description');
          }

       

      if (this.getField("Equipment Serial"+ rowNum).value == " ") {
           app.alert('Please enter an equipment serial number');
          }

      }

       

       

       

      Any help is appreciated.