本文介绍了HTML提交按钮:不同的值/按钮文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用 'add tag'创建一个HTML表单提交按钮,但是,网页是瑞典语,所以我想要有一个不同的按钮文本

也就是说,我想要一个像

的按钮



但我想让我的代码像

  if(request.getParameter(cmd).equals(add标签))
tags.addTag(/*...*/);

这可能吗?如果是这样,怎么做?

可能使用按钮元素。

 < button name =namevalue =valuetype =submit>Sök< / button> 

从的W3C页面


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:

这篇关于HTML提交按钮:不同的值/按钮文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-28 05:51
查看更多