JavaScript - CCK Text Fields in the Node Object // Cross-method Insights

Last updated on
30 April 2025

You are browsing documentation for an older version of Drupal, which is not supported any longer, and the information may not be correct. See current documentation for Contributed modules

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

Help improve this page

Page status: Not set

You can: