tags:

views:

37

answers:

2

hi

I have some problem to execute the following jquery validation program

email: {
   required: true,
   email: true,
   remote: "emails.php"
},

.........

in jquery validation

$.ajax($.extend(true, {
    url: param,
    mode: "abort",
    port: "validate" + element.name,
    dataType: "json",
   data: "email="+data,

The above codeing executed. but my problem is how to create the emails.php. Because i dont know how to get value from js file to emails.php. Pls replay me...

A: 

I think www.php.net is the right place to start.

Artem Barger
A: 

iam not completely sure what you would like to accomplish using this code:

$.ajax($.extend(true, {
    url: param,
    mode: "abort",
    port: "validate" + element.name,
    dataType: "json",
   data: "email="+data,

Why extend? extend merges parameter2, 3, ... into parameter 1. So, jQuery basically tries to put all you parameters into the little true.

i tried to construct an example for $.ajax which fits your needs:

$.ajax({
   url: "emails.php",
   data: "name=John&location=Boston",
   success: function(msg){
     alert( "Data Saved: " + msg );
   }
 });

for examples on creating the server side part, have a look into the demo section of the distributed zip file:

http://jquery.bassistance.de/validate/jquery.validate.zip

henchman