Jump to content
  • 0

Как сделать такую вещь ?


Sixella
 Share

Question

нужно создать форму, при которой обязательно необходимо заполнять поля отмеченные звездочкой. "*"

и как сделать так, что бы скрипт проверял все ли правильно заполнено ?

Заранее спасибо.

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

вот, но могут быть еще и ошибки конечно... все правда на французском языке, но суть вроде ясна... или нет ?

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=windows-1252">
<TITLE>title</TITLE>
<STYLE TYPE="text/css">
</STYLE>
<link rel="stylesheet" type="text/css" href="ex_01.css">
<style type="text/css">
<!--
body {
background-color : Black;
height : 500px;
width : 400px;
background-position: center;
}
div.c4 { text-align : left; }
table.c1 {
background-color : #000000;
width : 470px;
margin-left: 30%;
margin-right: 30%;
}
td.c2 {
width : 271px;
right: auto;
}
td.c3 { background-color : Black; width : 195px; }
.c5 { color : Black; }
.c6 { font-family : thorndale, serif; font-size : small; }
.style1 {color: #FF8040}
-->
</style>
</HEAD>
<body>
<A HREF="#null" OnClick="alert('Exemple OnClick'); return false" LANGUAGE="Javascript"></A>
<FORM ACTION="suite.html" METHOD="POST">
<table border=0 cellpadding=2 cellspacing=0 class="c1" id="table" align="center" >
<col width=271>
<col width=195>
<tr>
<td class="c2"><p align="right" class="style1">Identifiant :</p></td>
<td class="c3"><div class="c4 style1">
<p style="margin-left: 0.25cm; margin-right: 0.01cm; text-decoration: none">
<input type=TEXT name="texte" tabindex=1 size=20 style="width: 4.37cm; height: 0.64cm">
</p>
</div></td>
</tr>
<tr>
<td class="c2"><p align="right" class="style1">Mot de passe (6 caracteres minimum) :</p></td>
<td class="c3"><div class="c4 style1">
<p style="margin-left: 0.25cm; margin-right: 0.01cm; text-decoration: none">
<input type=PASSWORD name="password2" size=20 style="width: 4.34cm; height: 0.64cm; font-family: 'Courier New', monospace; font-size: 10pt">
</p>
</div></td>
</tr>
<tr>
<td class="c2"><p align="right" class="style1">Confirmez le mot de passe :</p></td>
<td class="c3"><div class="c4 style1">
<p style="margin-left: 0.25cm; margin-right: 0.01cm; text-decoration: none">
<input type=PASSWORD name="password" size=20 style="width: 4.34cm; height: 0.64cm; font-family: 'Courier New', monospace; font-size: 10pt">
</p>
</div></td>
</tr>
<tr>
<td class="c2"><p align="right" class="style1">Adresse email :</p></td>
<td class="c3"><div class="c4 style1">
<p style="margin-left: 0.25cm; margin-right: 0.01cm; text-decoration: none">
<input type=TEXT name="email" size=20 style="width: 4.34cm; height: 0.64cm">
</p>
</div></td>
</tr>
<tr>
<td class="c2"><p align="right" class="style1">Nom :</p></td>
<td class="c3"><div class="c4 style1">
<p style="margin-left: 0.25cm; margin-right: 0.01cm; text-decoration: none">
<input type=TEXT name="Nom" size=20 style="width: 4.34cm; height: 0.64cm">
</p>
</div></td>
</tr>
<tr>
<td class="c2"><p align="right" class="style1">Prenom :</p></td>
<td class="c3"><div class="c4 style1">
<p style="margin-left: 0.25cm; margin-right: 0.01cm; text-decoration: none">
<input type=TEXT name="Prenom" size=20 style="width: 4.34cm; height: 0.64cm">
</p>
</div></td>
</tr>
<tr>
<td class="c2"><p align="right" class="style1">Sexe :</p></td>
<td class="c3"><div class="c4 style1">
<p style="margin-left: 0.25cm; margin-right: 0.01cm; text-decoration: none">
<input name="sexe" type=RADIO style="width: 0.34cm; height: 0.34cm" checked>
<span class="c6"><span style="font-style: normal"><b>Homme
<input type=RADIO name="sexe" style="width: 0.34cm; height: 0.34cm">
Femme</b></span></span></p>
</div></td>
</tr>
<tr>
<td class="c2"><p align="right" class="style1">Adresse :</p></td>
<td class="c3"><div class="c4 style1">
<p style="margin-left: 0.25cm; margin-right: 0.01cm; text-decoration: none">
<input name="Adresse" type=TEXT style="width: 4.34cm; height: 0.64cm" size=20 maxlength="40">
</p>
</div></td>
</tr>
<tr>
<td class="c2"><p align="right" class="style1">Code Postal :</p></td>
<td class="c3"><div class="c4 style1">
<p style="margin-left: 0.25cm; margin-right: 0.01cm; text-decoration: none">
<input name="code postal" type=TEXT style="width: 4.34cm; height: 0.64cm" size=20 maxlength="5">
</p>
</div></td>
</tr>
<tr>
<td class="c2"><p align="right" class="style1">Ville : </p></td>
<td class="c3"><div class="c4 style1">
<p style="margin-left: 0.25cm; margin-right: 0.01cm; text-decoration: none">
<input type=TEXT name="ville" size=20 style="width: 4.34cm; height: 0.64cm">
</p>
</div></td>
</tr>
<tr>
<td class="c2"><p align="right" class="style1">Pays:</p></td>
<td class="c3"><div class="c4 style1">
<p style="margin-left: 0.25cm; margin-right: 0.01cm; text-decoration: none">
<select name="hero" style="width: 4.34cm; height: 0.56cm">
<option selected>Choisissez
<option value="t1">France
<option value="t2">Belgique
<option value="t3">Suisse
<option value="t4">Luxembourg
<option value="t5">Autres</option>
</select>
</p>
</div></td>
</tr>
<tr>
<td class="c2"><p align="right" class="style1">Vous êtes :</p></td>
<td class="c3"><div class="c4 style1">
<p style="margin-left: 0.25cm; margin-right: 0.01cm; text-decoration: none">
<input name="vous etes" type=RADIO style="width: 0.34cm; height: 0.34cm" checked>
<span class="c6"><span style="font-style: normal"><b>Particulier
<input type=RADIO name="vous etes" style="width: 0.34cm; height: 0.34cm">
Entreprise</b></span></span></p>
</div></td>
</tr>
<tr>
<td class="c2"><p align="right" class="style1">Vos centres d'interets:</p></td>
<td class="c3"><div class="c4 style1">
<p style="margin-left: 0.25cm; margin-right: 0.01cm; text-decoration: none">
<label>
<input type="checkbox" name="checkbox" value="checkbox">
</label>
Langage C </p>
<p style="margin-left: 0.25cm; margin-right: 0.01cm; text-decoration: none">
<label>
<input type="checkbox" name="checkbox2" value="checkbox">
UNIX</label>
</p>
<p style="margin-left: 0.25cm; margin-right: 0.01cm; text-decoration: none">
<label>
<input type="checkbox" name="checkbox3" value="checkbox">
xHTML - CSS</label>
</p>
<p style="margin-left: 0.25cm; margin-right: 0.01cm; text-decoration: none">
<label>
<input type="checkbox" name="checkbox4" value="checkbox">
PHP</label>
</p>
<p style="margin-left: 0.25cm; margin-right: 0.01cm; text-decoration: none">
<label>
<input type="checkbox" name="checkbox5" value="checkbox">
MySql</label>
</p>
<p style="margin-left: 0.25cm; margin-right: 0.01cm; text-decoration: none">
<label>
<input type="checkbox" name="checkbox6" value="checkbox">
Java</label>
</p>
<p style="margin-left: 0.25cm; margin-right: 0.01cm; text-decoration: none">
<label>
<input type="checkbox" name="checkbox7" value="checkbox">
UML</label>
</p>
</div></td>
</tr>
<tr>
<td class="c2"><label>
<input name="Envoyer" type="submit" value="Envoyer">
</label></td>
<td class="c3"><label>
<input name="Reset" type=reset onClick="alert('sure ?')" value="Annuler" language="Javascript">
</label></td>
</tr>
</table>
</FORM>
</BODY>
</HTML>

Link to comment
Share on other sites

  • 0
я так понял это уже Java тут идет ?

javascript. а без этого форму до отправки не проверить

что значит псевдовыбор ?

а это как во времена советского союза - выбрать-то можно, но вариантов только один: КПСС. так и сейчас в этой форме - жамкаешь очистить, тебе вопрос "вы уверены?", а ответить можно только согласием. поэтому надо либо убирать алерт, либо менять его на конфирм, а не пугать пользователя

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Обсуждения

    • Актуальные контакты: Telegram: @Nikker_web E-Mail:   tarasevich.email@gmail.com Портфолио https://www.behance.net/d4d4186e Разрабатываю дизайн групп в соц сетях, сайтов, приложений, другой дизайн под заказ    
    • Актуальные контакты: Telegram: @Nikker_web E-Mail:   tarasevich.email@gmail.com   Разрабатываю дизайн групп в соц сетях, сайтов, приложений, другой дизайн под заказ   Портфолио https://www.behance.net/d4d4186e
    • Доброго всем времени суток. Прошу помощи. Научите принципу изменения футера. Движок Xenforo. Версия 2.2.10. Стиль дефолтный. Что именно нужно в итоге на фото примере. Мой шаблон app.footer less имеет следующее значение.  .p-footer { .xf-publicFooter(); a { .xf-publicFooterLink(); } } .p-footer-inner { .m-pageWidth(); .m-pageInset(); padding-top: @xf-paddingMedium; padding-bottom: @xf-paddingLarge; } .p-footer-row { .m-clearFix(); margin-bottom: -@xf-paddingLarge; } .p-footer-row-main { float: left; margin-bottom: @xf-paddingLarge; } .p-footer-row-opposite { float: right; margin-bottom: @xf-paddingLarge; } .p-footer-linkList { .m-listPlain(); .m-clearFix(); > li { float: left; margin-right: .5em; &:last-child { margin-right: 0; } a { padding: 2px 4px; border-radius: @xf-borderRadiusSmall; &:hover { text-decoration: none; background-color: fade(@xf-publicFooterLink--color, 10%); } } } } .p-footer-rssLink { > span { position: relative; top: -1px; display: inline-block; width: 1.44em; height: 1.44em; line-height: 1.44em; text-align: center; font-size: .8em; background-color: #4682B4; border-radius: 2px; } .fa-rss { color: white; } } .p-footer-copyright { margin-top: @xf-elementSpacer; text-align: center; font-size: @xf-fontSizeSmallest; } .p-footer-debug { margin-top: @xf-paddingLarge; text-align: right; font-size: @xf-fontSizeSmallest; .pairs > dt { color: inherit; } } @media (max-width: @xf-responsiveMedium) { .p-footer-row-main, .p-footer-row-opposite { float: none; } .p-footer-copyright { text-align: left; padding: 0 4px; // aligns with other links } }  
    • Нужны сайты с примерами верстки, типа https://css-tricks.com/. Типовые приемы и нестандартные на все случаи жизни. Накидайте ссылок.
×
×
  • 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