HTML提交按钮:不同的值/按钮文本? [英] HTML Submit-button: Different value / button-text?
问题描述
我想用值 'add tag'
创建一个HTML表单提交按钮,但是,网页是瑞典语,所以我想要有一个不同的按钮文本。
也就是说,我想要一个像
的按钮
但我想让我的代码像
if(request.getParameter(cmd).equals(add标签))
tags.addTag(/*...*/);
这可能吗?如果是这样,怎么做?
可能使用按钮
元素。 < button name =namevalue =valuetype =submit>Sök< / button>
从关于按钮
:的W3C页面
使用BUTTON元素函数创建的按钮就像使用INPUT元素创建的按钮一样,但它们提供更丰富的呈现可能性:BUTTON元素可能具有内容。
I'd like to create an HTML form submit button with the value 'add tag'
, however, the web page is in Swedish, so I'd like to have a different button text.
That is, I want to have a button like
but I want to have my code like
if (request.getParameter(cmd).equals("add tag"))
tags.addTag( /*...*/ );
Is this possible? If so, how?
It's possible using the button
element.
<button name="name" value="value" type="submit">Sök</button>
From the W3C page on button
:
Buttons created with the BUTTON element function just like buttons created with the INPUT element, but they offer richer rendering possibilities: the BUTTON element may have content.
这篇关于HTML提交按钮:不同的值/按钮文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!