Jump to content
  • 0

Проверка заполнения хотя бы одного поля input до отправки?


Laroux
 Share

Question

Сразу оговорюсь: если есть вар без JS (в чем я сильно сомневаюсь), то было бы великолепно.

 

В общем все достаточно просто. Вот форма:

<form method=post action=""><input type=hidden name=CityID value=1><input type=hidden name=VeryNice value=no><input type=text pattern="^[1-9]\d*$" name="Summ1" class="auth w100"><input type=text pattern="^[1-9]\d*$" name="Summ2" class="auth w100"><input type=text pattern="^[1-9]\d*$" name="Summ3" class="auth w100"><input type=text pattern="^[1-9]\d*$" name="Summ4" class="auth w100"><select required name="CoordID"><option></option><option value="1">Иванов</option><option value="2">Петров</option><option value="3">Сидоров</option><option value="4">Сергеев</option><option value="5">Максимов</option></select><input type=submit name=saledone value="Оформить" class="auth w200"></form>

Тут есть 4 поля с именами Summ1, Summ2, Summ3 и Summ4. Мне необходимо, чтобы юзер заполнил хотя бы одно (можно больше, хоть все).

 

Как бы замутить?

 

Спасибо

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

Да ну это понятно. Но я не знаю, какое из 4-х полей заполнит пользователь. Они каждое по отдельности не обязательны. Обязательно заполнение хотя бы одного (любого из четырех) поля.

Edited by Laroux
Link to comment
Share on other sites

  • 0

Так вот в том и проблема, что я сам в JS не силен. Совсем просто что-то могу только, или подкорректировать что-то не очень навороченное


 Спасибо огромное.

P.S. Вы исчерпали лимит положительных оценок на сегодня

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy