隐藏的表单元素是否被提交? [英] Do hidden form elements get submitted?

查看:368
本文介绍了隐藏的表单元素是否被提交?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果在包含表单元素的<div>上使用jQuery的toggle(),即使隐藏了这些表单元素,这些表单元素也会与表单一起提交吗?

If jQuery's toggle() is used on a <div> containing form elements, will those form elements get submitted with the form, even though they are hidden?

我的代码(尽管这个特定问题可能不需要):

My code (though probably not needed for this particular question):

$('.cms_loop_title').click(function(){
    $ctg = $(this).attr('rel');
    $('.'+$ctg).toggle();
    //alert($ctg);
});

推荐答案

为了防止提交,您必须禁用元素.隐藏并不能解决问题(前段时间我也遇到过同样的问题)

In order to prevent submitting, you have to disable the elements. Hiding doesn't do the trick (I had the same issue a while ago)

这篇关于隐藏的表单元素是否被提交?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆