Expand my Community achievements bar.

SOLVED

Required Fields in a block?

Avatar

Former Community Member

I am creating a sign in sheet using Livecycle.  I want to make certain fields required if the user starts filling in that block of fields.

This is what it looks like:

First Name

Last Name

Email

Degree

Address

City, State, Zip

First Name

Last Name

Email

Degree

Address

City, State, Zip

First Name

Last Name

Email

Degree

Address

City, State, Zip

If someone fills in there first name, is there a way to require them to fill in their last name and email address?

When I have tried required fields it makes them required for the entire sheet, not that one record.

Thanks

1 Accepted Solution

Avatar

Correct answer by
Level 10

Sorry, had an error in my script the first line should be:

if (!this.isNull) {


or


if (!(this.isNull)) {

Extra bracket or non-closed bracket depending on your preference!

View solution in original post

6 Replies

Avatar

Level 3

Are you clicking the object then selecting the value tab under the object pallete?? Then choosing the dropdown of "User Entered - Required" for each filed that you want required??

Avatar

Former Community Member

Yes.  That makes the field required on the form but I need a field required when the first field is filled in.

So it needs to be something like this:  If user enters a first name then require a last name and email address.

Avatar

Level 10

You can set the required parameter with fieldName.mandatory = "error"; and disable it with fieldName.mandatory = "disabled";

So you could put something like the following on the Exit event of the first field:

if (!(this.isNull) { //if field isn't null

          Field2.mandatory = "error";

          Field3.mandatory = "error";

          //etc

}

else { //if field is null

          Field2.mandatory = "disabled";

          Field3.mandatory = "disabled";

          //etc

}


Avatar

Former Community Member

Jono,

I think I am headed in the right direction thanks to your help.

I added the code and changed it for my fields but it does not seem to be triggering.

topmostSubform.Page1.FirstName::exit - (JavaScript, client)

if (!(this.isNull) { //if field isn't null

          LastName.mandatory = "error";

          LicenseType.mandatory = "error";

          //etc

}

else { //if field is null

          LastName.mandatory = "disabled";

          LicenseType.mandatory = "disabled";

          //etc

}

Avatar

Correct answer by
Level 10

Sorry, had an error in my script the first line should be:

if (!this.isNull) {


or


if (!(this.isNull)) {

Extra bracket or non-closed bracket depending on your preference!

Avatar

Former Community Member

Thanks again for this answer.  It was perfect.