html不具有提交的按钮,HTML5 - 输入类型“提交”不显示英文按钮(HTML5 - input type “submit” does not show button in English)...

HTML5 - 输入类型“提交”不显示英文按钮(HTML5 - input type “submit” does not show button in English)

只是一个简单的问题:我正在玩html5,当我在我的html中放入一个按钮和一个输入(输入“提交”)标签时,我看到两个按钮 - 上面带有“提交”字样的按钮,以及输入一个用相同的单词但不是英文,但用我的母语。 我想知道 - 为什么? 是因为我的浏览器语言吗? 如果是这样,我该如何更改?

谢谢,yishai

Just a quick question: I'm playing around in html5, and when I put both a button and an input (type "submit") tags in my html I see two buttons - the button with the word "submit" on it, and the input one with the same word but not in English, but in my native language. I wonder - why is that? Is it because of my browser language? If so, how do I change it?

Thanks, yishai

原文:https://stackoverflow.com/questions/40956732

更新时间:2020-02-07 06:07

最满意答案

你在尝试什么? 你可以这样做

Submit

What are you trying? You can do this way

Submit

相关问答

默认情况下,jQuery不知道有关HTML5验证的任何信息,因此您必须执行以下操作: $('#submit').click(function(){

if($("form")[0].checkValidity()) {

//your form execution code

}else console.log("invalid form");

});

By default, jQuery doesn't know anything about the HTML5 va

...

我通过添加隐藏的提交输入元素来实现我的目标:

然后,我将以下代码附加到我的外部提交处理程序。 $('#upgrade_submit').click(function(){

$('#cc-form-modal .submit').click();

return false;

});

这将导致HTML5的验证运行,显示默认错误消息,并且一切正常! I accompl

...

HTML5表单验证过程仅限于通过提交按钮提交表单的情况。 表单提交算法明确表示,当通过submit()方法submit()表单时,不执行验证。 显然,这个想法是,如果您通过JavaScript提交表单,您应该进行验证。 但是,您可以使用checkValidity()方法根据HTML5属性定义的约束请求(静态)表单验证。 如果您希望显示与浏览器在HTML5表单验证中相同的错误消息,则恐怕您需要检查所有受限的字段,因为validityMessage属性是字段(控件)的属性,而不是表单。 在单一约束领域

...

这使用javascript,而不是jquery直接。 这可能有助于您开始。 function updateTextInput(val) {

document.getElementById('textInput').value=val;

}

...

如果您只是想要用户确认,请在表单标记中使用onsubmit属性。 https://jsfiddle.net/yetn60ja/

method="POST" action="/y/b/"

enctype="multipart/form-data"

οnsubmit="return confirm('Do you really want to submit the form?');"

>

Show prediction!

试试这个代码 function updateMap(e) {

e.preventDefault(); //the will prevent from page refresh if not

//apply you

...

表单正在重新加载,因为页面正在重新加载,请尝试从提交中返回false。 Submit

编辑 啊,抱歉。 那么页面没有重装? 或许试试这个: handleClick_: function () {

console.log("Submit button clicked");

var userId = this.use

...

你在尝试什么? 你可以这样做

Submit

What are you trying? You can do this way

Submit

您需要阻止默认操作(使用e.preventDefault() ) $('form.ajax').on('submit', function(e) {

e.preventDefault(); // Prevent default submit action (that is, redirecting)

var that = $(this),

url = that.attr('action'),

method = that.attr('method'),

...

我也必须在服务器上安装它,我不知道 I have to install that on the server as well, i don't know that

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值