Function Updated 23 Oct 2026
isName(value)
Checks that the text contains a space, as a simple test for "first name and last name". "Richard Dawson" gives true and "Richard" gives false — but any text with a space, such as "Richard " or "1 2", also gives true. It does not check that the parts are letters.
Parameters
valueobjectrequiredValue to validate.
Returns
true if the value is text containing at least one space, otherwise false.
Example
Normal JavaScript, running in the browser or on the Docly™ server.
write(docly.isName("Richard Dawson")); // Both first and last name specified
write("\n"); // New line
write(docly.isName("Richard")); // Only one name specified
write("\n"); // New line
write(docly.isName("")); // No name specified
write("\n"); // New line
write(docly.isName(null)); // No name specifiedThe JavaScript above produces this output:
true
false
false
false