HTML: Make a link, send to the form?

Do I really want to have a link, such as "Save", that act just like a submit type submit button?

I never understood how to do this, is it possible? How?

+5
source share
3 answers

You can simply hover the button so that it looks like a link:

input[type="submit"]
{
  background: transparent;
  text-decoration: underline;
  cursor: pointer;
}
+8
source

javascript is possible. eg:

<form name="theform" ...>
<a href="javascript:document.theForm.submit();">Save</a>
</form>

but I would suggest styling a button to look like a link, so you have no problems with clients without javascript

+2
source

:

:

<form id="myform" name="myform" method="post" action="something.php">

: <a href="javascript:postform()">Click!</a>

JavaScript:

<script language="JavaScript" type="text/javascript">
function postform( )
{
  document.getElementById('myform').submit() ;
}
</script>
+2

All Articles