Using custom javascript to validate a Currency field not working.

  • 2 May 2017
  • 1 reply
  • 5 views

Badge +5

Working with Forms 2010, v1.2.10.  Using custom javascript to validate a Currency field.  The field is a drop-down list with multiple values, the default being '-select-'.  However the code shown below allows the form to be submitted with the default entry (-select-).  I could swear it was working last week.  Any ideas?

Here is the custom javascript from the item form:

//Validation for Currency drop down field
 function validateCurrency(source, arguments) {
     var selectedCurrency = NWF$("#" + wfCurrency + ' option:selected');
     var selectedCurrencyValue = selectedCurrency.text();
     var sourceText = arguments.Value;
     alert('selectedCurrencyValue =  ' + selectedCurrencyValue);
     arguments.IsValid = true;
     if (selectedCurrencyValue == '-select-') {
         arguments.IsValid = false;
         alert('arguments.IsValid = ' + arguments.IsValid);
     }
 };

1 reply

Badge +5

The cause was other non-related script that caused the Currency validation to fail.

Reply