0

我在 html 中有这段代码:

<form action="/login/" method="post">
<input type="text" name="login">
<input type="text" name="pass">
<input type="submit" value="login"  name="type" >
<input type="submit" value="register" name="type" >

</form>

当我提交此表单时,它会发送一个get请求,其中包含单击的按钮字段的值。但是我想更改按钮的标签而不更改发送的值get。有没有可能?

4

1 回答 1

3

使用按钮元素:

<button type="submit" name="type" value="register">Sign up for an account</button>

请注意,旧 IE 对此有问题

于 2013-05-23T09:42:35.410 回答