#Validator for Words

15 messages · Page 1 of 1 (latest)

grim hedge
#

Is There some Validator Angular foor Words ?
I need validate two words in my input.
My code :
nome: ['', Validators.compose([Validators.maxLength(255), Validators.required])],

shut nest
#

What's the criteria you want for your validator?

grim hedge
#

I have one input, this input needs have name e last name.

#

both needs be required

astral osprey
#

Then use two inputs.

shut nest
#

If your API really expects just one field for both, you can always manipulate the form before submitting.

#

(but it's quite a strange endpoint on your backend side.)

grim hedge
#

I have a job for doing, and a the task is that.

shut nest
#

Is what?
That you need to present a single control to the user, or that you need to send a single field to the API?

grim hedge
#

I need validate 2 words in 1 input, but i'm going to talk with the owner for using two inputs.

shut nest
#

That's doable, but not so smart.
Better explain that to the client before writing useless code.

astral osprey
shut nest
#

Not even considering the n possible combinations: multiple names, multiple surnames, compound surnames...

astral osprey
#

Good luck finding if someone actually entered their name when they type someting like Jean Vincent: is it a composed first name, a composed last name, a first name and a last name, or a last name and a first name? You can't know. That's why everybody uses two inputs when you need to differentiate the first name from the last name

shut nest
#

Add some "de", "del", "los", "mac" in the middle.