Tag: cck

模拟点击多值cck字段的“添加更多值”按钮导致整个内容表单提交

嗨,我的cck内容类型中有一个多值cck字段。 我想模拟使用jquery点击“添加另一个项目”。 这就像 $(“#编辑现场增刊权场,人联党权,附加更多的”)的触发器(“点击”)。 但它导致整个内容表单提交而不是添加额外的多值cck字段。 Manuall点击工作完美无缺。 任何人都可以告诉我为什么手动点击和模拟点击的行为是不同的。 谢谢 —-更新—-这是我使用的代码: – $( ‘#编辑现场freightamount-0值’)。点击(函数(){ 警报( ‘你好’); $(“#编辑现场增刊权场,人联党权,附加更多的”)的触发器(“点击”)。 //$(‘.form-submit ahah-processed’)。trigger(’click’); }); 我实际上打算从其他function中调用它,但我只是想在此之前测试它。 所以我写了这个虚拟函数,就像我点击一个texrfield它应该模拟点击“添加更多项目” 我们如何防止点击的默认操作?

使用jQuery和Drupal6自动更新宽度/长度/区域

我正在使用Drupal创建一个测量表( Drupal 6中的测量表 ),并且我已经准备好所有字段,我只需要编写一些jQuery,当用户输入数据时自动更新相应的字段。 代码如下: jQuery(document).ready( function ($) { $(‘input’).change( function() { $parent = $(this).parent(“td”).children(“div”).children(“div”); length = $parent.children(“div[id*=’field-length-0-wrapper’]”).children(“div.container-inline”).children(‘div[id*=”field-length-0-value-wrapper”]’).children(‘input[id*=”field-length-0-value”]’).val(); // get the width width = $parent.children(“div[id*=’field-width-0-wrapper’]”).children(“div.container-inline”).children(‘div[id*=”field-width-0-value-wrapper”]’).children(‘input[id*=”field-width-0-value”]’).val(); // get the length $parent.children(“div[id*=’field-area-0-wrapper’]”).children(“div.container-inline”).children(‘div[id*=”field-area-0-value-wrapper”]’).children(‘input[id*=”field-area-0-value”]’).val(length * width); //put area } ); }); 这与以下表单代码交互: Measurements:   Room: Length: —mftin Width: —mftin Area: —ft2m2 -2-1012   Room: Length: —mftin Width: —mftin Area: […]