600字范文,内容丰富有趣,生活中的好帮手!
600字范文 > html 点击 重置 单选 单选按钮上需要的Html 5不会重置(Html 5 required on radio button wil not reset)...

html 点击 重置 单选 单选按钮上需要的Html 5不会重置(Html 5 required on radio button wil not reset)...

时间:2022-07-11 08:39:54

相关推荐

html 点击 重置 单选 单选按钮上需要的Html 5不会重置(Html 5 required on radio button wil not reset)...

单选按钮上需要的Html 5不会重置(Html 5 required on radio button wil not reset)

如果选中,为什么单选按钮组上的html5不会重置表单重置按钮。 例如,如果您选择其中一个单选按钮,然后单击重置表单按钮,它不会重置单选按钮组所需的验证,即使表单已重置,您在表单中有一个带有html5必需集的单选按钮组。 所以基本上你点击提交按钮而不选择任何东西,单选按钮被赋予红色轮廓然后你选择一个然后点击重置然后你可以提交表格而不选择单选按钮? 任何有关它为什么这样做的帮助将不胜感激。 我可能会误解它应该如何工作。 简单的测试

Why won't an html5 required on radio button group reset with form reset button if it was selected. for example you have a radio button group in a form with the html5 required set if you select one of the radio buttons then click the reset form button it doesn't reset the radio button group required validation so even though the form was reset. So basically you click submit button without selecting anything the radio buttons are given an outline in red then you select one and click reset you are then able to submit the form without selecting a radio button? any help on why it does this would be greatly appreciated. I may misunderstand how its supposed to work. Simple test

原文:/questions/44441177

更新时间:-02-11 17:29

最满意答案

这是因为您使用相同的名称作为单选按钮。如果您使用相同的名称,只能检查一个单选按钮。所以它通过验证

示例:单选按钮的名称不同。

示例:单选按钮的名称相同。

It is because you are using same name for the radio buttons.If you give the same name only one radio button of the can be checked.And so it passes the Validation

Example : Different name for radio buttons.

Example : Same name for radio buttons.

相关问答

$to = 'dinefour4@';

$subject = 'The subject';

$name = $_POST['name'];

$email = $_POST['email'];

$option = ""

if(isset($_POST['place']))

{

$option = $_POST['place'];

}

$mobile = $_POST['mobile'];

$message = <<

$name

$ema

...

代替 $("#enumCurrencyType").val(1);

尝试 $("#enumCurrencyType[value='1']").prop('checked',true);

要么 $("#enumCurrencyType[value='1']").attr('checked','checked');

编辑: - 由于EnumRadioButtonFor()生成的HTML中的id是_enumCurrencyType_HomeCurrency ,所以试试这个: - $("#_enum

...

正如你所说,没有值为“null”的单选按钮,因此可观察对象将找不到任何合适的DOM来移动checked属性。直到可观察的开发人员重写check属性如何使用null值,你可以使用jquery或这个javascript代码 检查这个道场 As you said there is no radio button with value "null", therefor observable object won't find any suitable DOM to move the checked pro

...

您可以通过赋值null来使用ngModel重置单选按钮

[(ngModel)]="gender" (click)="filter_source_type(0)" name="gender"

value="male"> Adm

...

哪里是:$ this-> form_validation-> run()? 我的代码(没关系): $this->form_validation->set_rules('what_licence', 'What licence', 'required|in_list[1,2]');

$this->form_validation->set_rules('initials', 'Initials', 'trim|required|alpha');

$this->form_

...

由于ngChecked只有一次可以使用ng-model: ng-model="testCheck.button1"

并在你的函数resetall: $scope.button1 = false;

testCheck应该包含x个按钮(button1,2 ...) JSFiddle 在这里 。 As ngChecked only works 1 time you can use ng-model: ng-model="testCheck.button1"

and in your function

...

您的问题是resetForm是a.validate(...)返回的验证器对象上的一个方法,而不是jQuery对象本身。 function resetValidator(){

var a = $("#yourFormName").validate();

a.resetForm();

}

Your problem is that resetForm is a method on the validator object returned by a.validate(...), and not on

...

这是因为您使用相同的名称作为单选按钮。如果您使用相同的名称,只能检查一个单选按钮。所以它通过验证 示例:单选按钮的名称不同。

...

要使用无线电required ,您只需要为该组的每个输入保留name 。 这个问题根本不是关于VueJS的。 它只是关于HTML。

To

...

这里是演示使用margin-left的小提琴 button.reset-btn{

margin-left:20px;

}

here is the fiddle demonstrating the use of margin-left button.reset-btn{

margin-left:20px;

}

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。