Drupal 6/jQuery Ajax更新字段

我在同一个站点上的路径不同,我需要允许用户更改他/她在不同位置写入的节点上的字段内容.我有nodeid和字段名称,以及ids等np.

我不相信这太难了,但教程或解释会很精彩.

谢谢.

编辑:谢谢anschauung的询问,所以澄清一下:

这是CCK textarea.至于为什么,有一个中心节点类型,有许多链接节点参考节点.从引用中心节点的任何节点的编辑页面,它需要能够编辑和保存中心节点的字段.这就是我的用例.

再次感谢.

非常感谢googletorp,我非常感谢你的帮助.

这是我到目前为止所拥有的:

对于第一步:

function update_main_field_menu() {

  $items = array();

  $items['update_main_field/%'] = array(
    'title' => 'Update Main Field','page callback' => 'post_to_main_node','page arguments' => 1,'type' => MENU_CALLBACK
  );

  return $items;
}

第二步:

function post_to_main_node(){
    // Sorry,I'm totally lost. What do I put here?
}

你也提到了这个:

Either in hook_form_alter,
hook_nodeapi or some other hook that
is invoked when the node form is
generated. You should investigate
which is best in your situation.

如何生成节点表单?

第三步:

function modulename_form_mainct???_node_form_alter (&$form,&$form_state) {

    // I'm not sure about which form I'm doing node form alter on. If I do it to the mainct,wouldn't that alter the regular edit page the user is viewing? I only want to load the js for the ajax submission. Is there a update_main_field node form?


    drupal_add_js(drupal_get_path('module','modulename') ."/updateField.js");
}

此外,步骤2中的功能与步骤3中的节点形式之间的区别是什么?

步骤4:
我想我大部分都理解,但由于其他事情,我还无法测试它.

相关文章

页面搜索关键词突出 // 页面搜索关键词突出 $(function () {...
jQuery实时显示日期、时间 html: <span id=&quot...
jQuery 添加水印 <script src="../../../.....
中文:Sys.WebForms.PageRequestManagerParserErrorExceptio...
1. 用Response.Write方法 代码如下: Response.Write(&q...
Jquery实现按钮点击遮罩加载,处理完后恢复 思路: 1.点击按...