Browse Source

add Ins.php, verif_inscription.js file to complete and modify

FENNICHE Ouahab 5 years ago
parent
commit
1e31cb042c
6 changed files with 156 additions and 0 deletions
  1. BIN
      .DS_Store
  2. BIN
      WebContent/.DS_Store
  3. 118 0
      WebContent/Ins.php
  4. BIN
      WebContent/WEB-INF/.DS_Store
  5. 14 0
      WebContent/css/style1.css
  6. 24 0
      WebContent/js/verif_inscription.js

BIN
.DS_Store


BIN
WebContent/.DS_Store


+ 118 - 0
WebContent/Ins.php

@@ -0,0 +1,118 @@
+<html>
+<head>
+<title>Inscription</title>
+<script type="text/javascript" src="js/verif_inscription.js"></script> 
+    <link rel="stylesheet" type="text/css" href="css/style.css">
+    <link rel="stylesheet" href="css/style1.css" type="text/css"  />
+    <link rel="stylesheet" href="css/style.css" type="bootstrap/css/bootstrap.min.css"  />
+</head>
+<body>
+<fieldset>
+  <legend><h2>Inscription</h2></legend>
+    <div id="principal">
+        <div class="header">
+
+        </div><!-- end of header -->
+<form name="fo" method="post"  action="inscription.php"  onsubmit="return verif();" >
+
+    <table>
+        <tr>
+            <td>
+                <label for="nom">Nom : </label>
+            </td>
+            <td>
+                <input type="text" name="nom" id="nom" />
+                <br />
+            </td>
+        </tr>
+        <tr>
+            <td>
+                <label for="prenom">Prenom : </label>
+            </td>
+            <td>
+                <input type="text" name="prenom" id="prenom" />
+                <br />
+            </td>
+        </tr>
+        <tr>
+            <td>
+                <label for="sexe">Sexe : </label>
+            </td>
+            <td>
+                <input type="radio" name="sexe" id = "sm" value="M" /> H
+                <input type="radio" name="sexe" id = "sf" value="F" /> F
+                </br>
+                <span>Autre</span>
+                <br />
+                <input type="text" name="sexe" id = "si" value=""  />
+                <br />
+            </td>
+        </tr>
+        <tr>
+            <td>
+                <label for="date_naissance">Date de naissance : </label>
+            </td>
+            <td>
+                <input type="date" name="date_naissance" id="date_naissance" value=""/>
+                <br />
+            </td>
+        </tr>
+        <tr>
+            <td>
+                <label for="ville">Ville : </label>
+            </td>
+            <td>
+                <input type="text" name="ville" id="ville"/>
+                <br />
+            </td>
+        </tr>
+        <tr>
+            <td>
+                <label for="email">Mail : </label>
+            </td>
+            <td>
+                <input type="text" name="email" id="email" value="...@..."/>
+                <br />
+            </td>
+        </tr>
+        <tr>
+            <td>
+                <label for="tel">Téléphone : </label>
+            </td>
+            <td>
+                <input type="text" name="tel" id="tel" />
+                <br />
+            </td>
+        </tr>
+        <tr>
+            <td>
+                <label for="contact">Personne à contacter en cas d'urgence : </label>
+            </td>
+            <td>
+                <input type="text" name="contact" id="contact" />
+                <br />
+            </td>
+        </tr>
+        <tr>
+            <td>
+                <label for="piecejointe"> Pièce jointe : </label>
+            </td>
+            <td>
+                <input type="file" name="piecejointe" id="piecejointe" size="60" class="w750" />
+                <br />
+            </td>
+        </tr>
+
+    </table>
+
+                <input type="submit" value="Valider">
+
+                <input type="reset" value="Annuler">
+
+
+</form>
+        <div class="footer"></div><!-- end footer div -->
+</fieldset>
+
+</body>
+</html>

BIN
WebContent/WEB-INF/.DS_Store


+ 14 - 0
WebContent/css/style1.css

@@ -81,6 +81,20 @@ form input[type=text],input[type=password]{
   /*background-image: url("img/f.png");
   background-repeat: repeat;  */
 }
+form input[type=date],input[type=password]{
+  border: 1px solid #fd3521;
+  width: 200px;
+  height: 25px;
+  margin: 3px;
+  color:red
+  
+}
+
+form input[type=radio]{
+  color:red
+  
+}
+
 form input[type=submit]{
   background-color: #fd3521;
   color: #FFF;

+ 24 - 0
WebContent/js/verif_inscription.js

@@ -0,0 +1,24 @@
+function verif() {
+ df=document.fo;
+ msg='';
+ with (df) {
+   if (nom.value.length==0)
+       {msg+='nom manquant\n';}
+   if (prenom.value.length==0)
+       {msg+='prenom manquant\n';}
+   if (!sexe[0].checked && !sexe[1].checked )
+       {msg+='sexe non selectionné\n';}
+   if (email.value.length==0)
+       {msg+='email manquant\n';}
+   else if (!/^\w+[\.\_\-]*\w*@{1}\w+[\.\_\-]*\w*.{1}\w+/.test(email.value))
+           {msg+='email non valide\n';}
+   if (pays.ville=="")
+       {msg+='pays non selectionné\n';}
+ }
+ if (msg=='') {
+   return 'true'
+ }else{
+   alert('Important :\n'+msg)
+   return false
+ }
+}