Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Replacing submit button with text?

I'm hoping to replace the standard ugly submit button on my form with text. I know how to replace it with an image by changing the submit to this:

<input type="image" name="submit" src="submit.png" width="70px" height="30px">

But I would like to change it to text, is this possible? Thank you

like image 994
Jake Avatar asked Dec 19 '10 22:12

Jake


People also ask

How do I change the submit button text?

The value attribute can be used to change the text of the form submit button. Use value attribute within <input> of type="submit" to rename the button.

Can a button be of type submit?

The <button> tag with a type="submit" attribute creates a submit button.

How do I change the submit button text in Google forms?

Change confirmation messageIn Forms, open a form or quiz. Presentation. Next to Confirmation message, click Edit and enter your text. Click Save.

Should I use button or input type submit?

input suggests that the control is editable, or can be edited by the user; button is far more explicit in terms of the purpose it serves. Easier to style in CSS; as mentioned above, FIrefox and IE have quirks in which input[type="submit"] do not display correctly in some cases.


2 Answers

you can use an anchor tag with javascript to trigger the form change. e.g.

<form id="myForm" ...>
  ...
  <a href="#" onclick="document.getElementById('myForm').submit();">Submit</a>
</form>

You could also use almost any textual tag, by the way, just binding to the onclick event (a <span> for instance).

like image 77
Brad Christie Avatar answered Oct 03 '22 14:10

Brad Christie


No, you need to use a different HTML entity (i.e, just a link).

But, I'd recommend you don't change it. It's better, from a user experience point of view, to use the typical submit buttons, perhaps styled slightly if appropriate, but nevertheless remaining as close to 'typical' as possible.

The reasoning is that OS' display the button in different (and familiar) ways to the user, and it's good UI design practice to follow "standards". This iy just my humble opinion.

Technically, you can quite easily make a link do the form submission, by setting the onclick event to something appropriate (like: onclick="return doFormSubmit();").

like image 36
Noon Silk Avatar answered Oct 03 '22 13:10

Noon Silk