Hello All.
Livecycle designer 8.0
I have dynamic table (myTable) and it has four fields Name,SSN,Telephone,email. In runtime the table would have 10 rows by default.
How to make the user enter all fields. i.e if he enters atleast one field then all the other fields should be made required. Example if he enters Name , then he should enter SSN,Telephone,email is a must.
But other rows could have all null values.
Thanks for any input.
So, First you need a function, attached to the table row subform that tests all of the fields in the row for a non-empty value, and does the mandatory setting.
Then, in the validate event for each of the text fields in the row, place code that calls this function.
A text field empty test should be something like this.
if( (textField.rawValue != null) && !/^\s*$/.test(textField.rawValue) )
{
// Field is non-empty
}
The validate event is perfect since the data is in the process of being commited and availible in the "rawValue" property of the field. But since this is the "Validate" event, you must place this line at the end of the script
true;
So that the entry isn't inadvertantly invalidated.
Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]
The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script