我製作了一個HTML表單,可以在我的網站上添加一個朋友,我希望能夠通過我提供的鏈接提交。我曾嘗試做onClick="form.submit();"
,但沒有奏效。我做了一個HTML表單,我想用鏈接提交它
</head>
<body>
<div class="Forum-Block">
<div class="Top-Bar">
<a href="http://site/Forum.php"><div class="Back-Box">Back</div></a>
<a href="http://site/ShowFriends.php"><div class="FriendsB-Box">Friends</div></a>
<a href="http://site/ShowSentRequests.php"><div class="RequestsB-Box">Sent Requests</div></a>
<a href="http://site/AddFriend.php"><div class="SendRequestB-Box">Send Request</div></a>
</div>
<div class="FriendRequestSend-Box">
<form method="post">
<input type="text" name="friendname"/>
<br/>
<a href="http://site/AddFriendPHP.php" onclick="form.submit();"><div class="FriendRequestSend-Button">Send</div></a>
</form>
</div>
</div>
</body>
爲什麼它不工作,你得到了什麼錯誤,你有沒有嘗試過其他的東西。 http://stackoverflow.com/help/how-to-ask – Mathemats