Javascript-форум (https://javascript.ru/forum/)
-   Общие вопросы Javascript (https://javascript.ru/forum/misc/)
-   -   Проверка отправки формы (https://javascript.ru/forum/misc/48537-proverka-otpravki-formy.html)

alexwebmaster 07.07.2014 22:34

Проверка отправки формы
 
Ребят помогите, есть форма в ней 2 поля как проверить что они не пусты при отправки, если пусты то не отправлять, если заполнены то отправить?

форма:

<form action="send3.php" method="post">
<h2 style="font-size: 18px;text-align: center;padding-bottom: 10px;">Название</h2>
<input style="width: 211px;height: 25px;border: none;font: 14px open_sanslight;color: #b3b3b3!important;padding: 0 0 0 7px;border: 1px solid;display: block; "type="text" name="fio" class="area" onblur="if (this.value == '') {this.value = 'имя';}" onfocus="if (this.value == 'имя') {this.value = '';}" type="text" value="имя"/><br />

<input style="width: 211px;height: 25px;border: none;font: 14px open_sanslight;color: #b3b3b3!important;padding: 0 0 0 7px;border: 1px solid;display: block; "type="text" name="cellphone" class="area" onblur="if (this.value == '') {this.value = 'Телефон';}" onfocus="if (this.value == 'Телефон') {this.value = '';}" type="text" value="Телефон"/><br />

<br/><input style="background:#85c970; color:#fff;"type="submit" name="sendMessage" class="button" value="Отправить" />
</form>


Часовой пояс GMT +3, время: 20:06.