Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.
SOLVED

Null error

Avatar

Level 2

Hi,

I have two fields on the form and tried to validate the name and line manager fields to make sure that user has entered both fields. Funny thing is that the name field(which is the first field) seems to be empty all the time even when I have entered a string into the input field, but the second field (the line manager field) is working fine. Does anyone know why?

Script:

var nameField = name.rawValue;

xfa.host.messageBox(nameField); //testing to see what user has entered --> it's always empty even if I've entered something

if(name.isNull){
errorMsg = "Please enter your name.\n";
}
if(lineManager.isNull){
errorMsg = errorMsg + "Please enter your line manager's name.\n";
}

Regards,

F.

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

"name" is a reserved word, which is used to return the name of an object.

Use something like "firstName" and it should work okay.

Hope that helps,

Niall

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

Hi,

"name" is a reserved word, which is used to return the name of an object.

Use something like "firstName" and it should work okay.

Hope that helps,

Niall

Avatar

Level 2

yes!!! It's working now. Thanks!!