Answer the question
In order to leave comments, you need to log in
Form validation (required fields)
This is the first time I've come across such a situation.
Here is a similar form.
<form action='name.php'>
Введите ваше имя: <input name='name' type='name' value='namel' />
Введите email: <input name='email' type='email' value='Не email' /> или
Введите сотовый телефон: <input name='tel1' type='tel' pattern='8[0-9]{10}'/>
<input type='submit' value='Отправить' />
Answer the question
In order to leave comments, you need to log in
<input name='email' type='email' value='Не email' required='required' />
Well, check for an empty value
if(document.getElementsByName('email')[0].value === ""
&& document.getElementsByName('tel1')[0].value === ""
) {
alert("Пожалуйста заполните, 'email' или 'telephone'");
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question