14
4

4 に答える 4

30

<a>タグのみを使用してフォームを送信することはできません。タグの使用を主張する場合は、何らかのタイプの JavaScript必要になります。<a>

<a href="#" onclick="$(this).closest('form').submit()">Submit the Form</a>

また

<a href="#" onclick="document.getElementById('form-id').submit()">Submit the Form</a>

またはスーパーハック:

<a href="backendPage.php?param1=yes&param2=no">Submit the Form</a>、次に backendPage.php で$_GETリクエストを使用して情報を処理し、訪問者を目的のページにリダイレクトできます。しかし、それは恐ろしい考えです笑

于 2013-06-13T02:22:14.833 に答える
22

これを試して:

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>
于 2013-06-13T02:20:41.997 に答える