JavaScript - CCK Text Fields in the Node Object // Cross-method Insights
// Modules
// // # SERVICES 6.x-2.0 and JSON SERVER 6.x-2.0-alpha1
// + + Data Object
Node.Save (and edit)
http://drupal.org/node/774116
///////// CCK TEXT FIELDS
In the code box below refer to:
cck_field_a = [{ "value": "my cck field a" }];
// Which translates to:
// cck_field_a = [];
// cck_field_a[0] = {};
// cck_field_a[0].value = "my cck field a";
This is how CCK text fields are formatted.
// // CCK
var cck_field_b_string = "my cck field b";
data.node_object.cck_field_a = [{ "value": "my cck field a" }];
data.node_object.cck_field_b = [{ "value": cck_field_b_string }];
// // Title
// // // CCK fields are placed in the node_object, just as the basic 'title' is placed there
data.node_object.title = "New Post. Title: " + cck_field_b_string;
// Etc
Refer back to // // http://drupal.org/node/774116
// #### Reference: Services & JavaScript
JavaScript - Node.Save & Edit // Cross-method Insights
http://drupal.org/node/774116
JavaScript - CCK Fields in the Node Object // Cross-method Insights
http://drupal.org/node/776122
JavaScript - Comment.Save
http://drupal.org/node/788892
JavaScript - JSON Server // Request.JSON (MooTools Example)
http://drupal.org/node/522942
JavaScript - JSON Server // Request.JSONP (MooTools Example)
http://drupal.org/node/791922
Comments
line 170 or so of node_service.inc
If you're using the JSON_SERVER (maybe not even that) and have some custom CCK fields, you might want to do something like this. It works fine for basic fields... not sure about more complex ones.