使用< a>提交表单锚点元素,没有JavaScript [英] Submit a form using <a> anchor element, without javascript

查看:149
本文介绍了使用< a>提交表单锚点元素,没有JavaScript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何用链接替换提交按钮而不使用JavaScript?有什么方法可以将提交属性添加到链接?因为表单不会通过一个简单的链接发送而不需要提交。

 < form:form action =/ getPage > 
< div class =buttons>

< a class =linkhref =>
< img src =icon.png/>
< / a>

< / div>
< / form:form>

我在应用程序网络中工作,所以如果我使用javascript,链接将不会被服务器映射。 。

解决方案

试试这个:

CSS strong>

 按钮{
background:none!important;
border:none;
填充:0!重要;
/ * border可选* /
border-bottom:1px solid#444;
}

HTML $ b

 <按钮>按钮看起来像链接< / button> 


How to replace the submit button with a link without using javascript ? is there any way to add the submit attribute to a link ? because the form will not be sent by a simple link without "submit".

<form:form action="/getPage" >
     <div class="buttons">

         <a class="link" href=""> 
           <img src="icon.png" />
         </a>

     </div>         
</form:form>

I work in an application web so if i use javascript the link will not be mapped by the server ..

解决方案

Try this:

CSS

button {
    background:none!important;
    border:none; 
    padding:0!important;
    /*border is optional*/
    border-bottom:1px solid #444; 
}

HTML

<button>your button that looks like a link</button>

这篇关于使用&lt; a&gt;提交表单锚点元素,没有JavaScript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆