简体   繁体   English

向导单选按钮不起作用并发布?

[英]Wizard radio button checked not work and post?

I am not getting data from class which is selected - radio button not post. 我没有从所选的课程中获取数据-单选按钮未发布。

Live example: https://www.kodjs.com/uyeol.php 实时示例: https//www.kodjs.com/uyeol.php
All-Code jQuery: https://jsfiddle.net/8Lbsdduv/1/ 全代码jQuery: https : //jsfiddle.net/8Lbsdduv/1/

$('[data-toggle="wizard-radio"]').click(function(){
        wizard = $(this).closest('.wizard-card');
        wizard.find('[data-toggle="wizard-radio"]').removeClass('active');
        $(this).addClass('active');
        $(wizard).find('[type="radio"]').removeAttr('checked');
        $(this).find('[type="radio"]').attr('checked','true');  

/*My code*/

$( "input" ).on( "click", function() {
  $( "#log" ).html( $( "input:checked" ).val());
});

Try replacing 尝试更换

$(wizard).find('[type="radio"]').removeAttr('checked');
$(this).find('[type="radio"]').attr('checked','true');

with this 有了这个

$(wizard).find('[type="radio"]').prop('checked', false);
$(this).find('[type="radio"]').prop('checked',true);  

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM