[jQuery] Help About Using JQuery With Struts 2

2009-04-25 Thread ibmso...@gmail.com

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"%>






Insert title here


  
 


 Identifiant :  

 


 Mot de passe :  




 Comfirmer le mot de passe :  





Nom :  





Pr�nom :  





Sexe :  





Email :  






Adresse :  






T�l�phone :  






  
 




   



--- 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 =)


[jQuery] Re: Help About Using JQuery With Struts 2

2009-04-28 Thread ibmso...@gmail.com

The Problem Is That When i Don't Put an Action like :
   , the form doesn't want to add
the data

But Whene i Put something like :
  It Works , But
The Field That use struts r not those that i recuperate from
var loginClient = $("input#loginClient").val();
var passwordClientError = $("input#passwordClient").val();

struts uses the input field directly from the jspFile .

--
And When i don't put anything in action of the form :: like this 
and execute the  :
 $.ajax({
type: "POST",
url: "/AddNewClient",
data: dataString,
success: function() {
   $('#Great').html('Great It\'s Done');
}
  });

gives me an error which is :: the action u r trying to perform is not
defined , (something like that)
thx Steven , which this will make u understand a bit more =)


On Apr 27, 1:26 am, Steven Yang  wrote:
> are you getting any error?or what are u getting at the server side?
> can you explain a bit more?