cancel
Showing results for 
Search instead for 
Did you mean: 

Get form field values in formValidateBeforeSubmit

chuck_irvine
Champ on-the-rise
Champ on-the-rise
in the JavaScript body of a formValidationBeforeSubmit how do I the value of form fields for my validation code? Probably simple, but I'm not finding  it.

Thanks
1 REPLY 1

gdharley
Elite Collaborator
Elite Collaborator

Hey Chuck,

Actually this is a harder problem than I expected, but as you summized, there is a helper function available to retrieve a form field by it's ID.

Below is the code I put inside a "formValidateBeforeSubmit" function:

var thisUn1 = scope.findFormFieldWithId(scope.allFormFields, 'label1');
var thisUn2 = scope.findFormFieldWithId(scope.allFormFields, 'singleentry');
alert(thisUn1.id + ":" + thisUn1.value);
alert(thisUn2.id + ":" + thisUn2.value);

Hope this helps,
Greg