i Really Need Some Of Struts Form Submession Examples, That Will Help
Me on my Current Project , i Tried hard To Add A New Client In my
Database , But That's Not Working , this is the code ::>

----------------------------------------------------This Is My JSP
FILE-----------------------------------------------------
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://
www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script language="javascript" type="text/javascript" src="_js/
jquery-1.3.2.min.js"></script>
<script language="javascript" type="text/javascript" src="_js/
work.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
      <div id="contact_form">
     <form name="contact"  action ="" >
<table>
        <tr>
                <td class="FieldStyle"> Identifiant :  </td>
    <td><input type = "text" name="loginClient" id="loginClient"
value="" ></td>
                <td><html:errors name="loginClientError" /> </td>
        </tr>
        <tr>
                <td> Mot de passe :  </td>
                <td><input type ="password" name="passwordClient"
id="passwordClient" value=""/></td>
                <td><html:errors name="passwordClientError" /></td>
        </TR>
        <tr>
                <td> Comfirmer le mot de passe :  </td>
                <td><input type="text" name="passwordClient2" 
id="passwordClient2"
value=""></td>
                <td><html:errors name="passwordClientError2" /></td>
        </TR>

        <TR>
                <td>Nom :  </td>
                <td><input type="text" name="nomClient" id="nomClient" 
value=""/></
td>
                <td><html:errors name="nomClientError" /></td>
        </TR>

        <tr>
                <td>Pr�nom :  </td>
                <td><input type="text" name="prenomClient" id="prenomClient"
value="" /></td>
                <td><html:errors name="prenomClientError" /></td>
        </tr>

        <tr>
                <td>Sexe :  </td>
                <td><input type="text" name="sexeClient" id="sexeClient" /></td>
                <td><html:errors name="sexeClientError" /></td>
        </tr>

        <tr>
                <td>Email :  </td>
                <td><input type="text" name="emailClient" id="emailClient"  
/></td>
                <td><html:errors name="emailClientError" /></td>
        </tr>


        <tr>
                <td>Adresse :  </td>
                <td><input type="text" name="adresseClient" id="adresseClient" 
/></
td>
                <td><html:errors name="adresse" /></td>
        </tr>


        <tr>
                <td>T�l�phone :  </td>
                <td><input type="text" name="telClient" id="telClient" /></td>
                <td><html:errors name="telClientError" /></td>
        </tr>


        <tr>
                <td><input type="submit" name="submit" class="button"
id="submit_btn" value="Send" /> <div id="Great"></div> </td>
                <td><input type="reset" name="annuler"  value ="Annuler" /> 
</td>
        </tr>
</table>
<form>
   </div>
</body>
</html>

--------------------------------------------------- This Is My Script
------------------------------------------------------
// JavaScript Document
$(document).ready(function(){



                         $(function() {

   $(".button").click(function() {

          var loginClient = $("input#loginClient").val();
          var passwordClientError = $("input#passwordClient").val();
          var passwordClient2 = $("input#passwordClient2").val();
          var nomClient = $("input#nomClient").val();
          var prenomClient = $("input#prenomClient").val();
          var sexeClient = $("input#sexeClient").val();
          var emailClient = $("input#emailClient").val();
          var adresseClient = $("input#adresseClient").val();
          var telClient = $("input#telClient").val();


         var dataString = 'loginClient='+ loginClient +
'&passwordClientError=' + passwordClientError + '&passwordClient2=' +
passwordClient2+ '&nomClient=' + nomClient+ '&prenomClient=' +
prenomClient+ '&sexeClient=' + sexeClient + '&emailClient=' +
emailClient+ '&adresseClient=' + adresseClient+ '&telClient=' +
telClient;






    //
     $.ajax({
    type: "POST",
    url: "AddNewClient.do",
    data: dataString,
    success: function() {
       $('#Great').html('Great It\'s Done');
    }
  });

  //   alert (dataString);
    return false;

   });
  });


                            });


Hope I Can Find Some Help =)

Reply via email to