【问题标题】:Next page by selecting radio buttons not with clicking next page下一页通过选择单选按钮而不是单击下一页
【发布时间】:2013-07-11 16:03:21
【问题描述】:

我想要的是,当我点击单选按钮时,它会将我带到下一页,而我实际上并没有点击下一页。
目前我必须点击下一页

申请表链接:http://goo.gl/CNgJq

我已经编写了这段代码,但它似乎不起作用:

(function ($, Drupal, window, document, undefined) {
    $(document).ready(function() {
        $('.form-radio').click(function() {
            $('.next-tab mover').click();
        });
    });
})(jQuery, Drupal, this, this.document); 

谁能告诉我这段代码我做错了什么?

【问题讨论】:

    标签: jquery ajax drupal radio-button drupal-webform


    【解决方案1】:

    测试用例:http://jsbin.com/acopuj/1/edit

    $('.next-tab mover') // <---- that's wrong
    

    应该是:

    $('.next-tab.mover') // the button has both classes, add '.' and remove 'space'
    

    【讨论】:

      【解决方案2】:

      查看您的页面,您需要将选择器更改为$('.next-tab.mover')。这将找到具有next-tabmover 类的元素。

      $('.form-radio').click(function() { $('.next-tab.mover').click(); });
      

      【讨论】:

      • 不是...我在输入我的答案时没有收到通知说已经有答案
      【解决方案3】:

      你可以试试这个

      $('.form-radio').on('click', function() {
          $('.next-tab.mover').trigger('click);
      });
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2020-12-27
        • 1970-01-01
        • 1970-01-01
        • 2013-12-14
        • 2014-11-26
        • 2021-04-09
        • 1970-01-01
        • 2011-02-10
        相关资源
        最近更新 更多