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

×
×
  • 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