>like in the subject, I do a query with $.ajax on a php file,
>the query retrieve a "name" and a "surname", in which format I must send
>out the data from my php file? And how I can manage this data to fill
>in the appropiate field in my form?
>
>My actually jQuery code :
>$.ajax({
>  type: "POST",
>  url: "test.php",
>  data: "query:edit&id="+idval,
>  success: function(data){
>    //what code I must put inside here, first for reading the data
>    //and next using it to fill the fields in my form?
>  }
>});

Check out my Field plug-in:
http://jquery.com/plugins/project/field

You can use this to update your fields, below is some sample syntax:

Examples

* $("[EMAIL PROTECTED]'users']").fieldArray();
  Returns an array of all values selected or entered for the selector. If
the selector was a checkbox or select element, the array would contain the
value of each item selected/checked.

* $("[EMAIL PROTECTED]'users']").fieldArray(["dan", "joern", "karl", "john"]);
  Sets the value of the field to "dan,joern,karl,john". If the selector was
a checkbox or select element, then the options with the values of "dan",
"joern", "karl" and "john" would be selected--all other options would be
unselected.

* $("[EMAIL PROTECTED]'users']").getValue();
  Returns a comma delimited string of all values selected or entered for the
selector. If the selector was a checkbox or select element, the string would
contain the value of each item selected/checked as a separate item in the
list.

* $("[EMAIL PROTECTED]'users']").setValue("dan,joern,karl,john");
  Sets the value of the field to "dan,joern,karl,john". If the selector was
a checkbox or select element, then the options with the values of "dan",
"joern", "karl" and "john" would be selected--all other options would be
unselected.

Reply via email to