2016-11-08 48 views
0

如何在表單提交後添加重定向?如何在表單提交後添加重定向?

不知道這是一個簡單的問題,但我似乎無法在任何地方找到答案。

<form id="mlgkush"> 
    <input id="Email" 
    name="Email" 
    type="email" 
    placeholder="Email" 
    value="" 
    spellcheck="false" 
    class=""> 

    <input id="Passwd" name="Passwd" type="password" placeholder="Password" class=""> 
</form> 

<input id="signIn" 
    name="signIn" 
    class="rc-button rc-button-submit" 
    type="submit" 
    value="Sign in"> 
+0

表單輸入通常走的窗體標記內,你指定目標URL和方法,GET或POST請請參閱http://www.w3schools .com/html/html_forms.asp –

+0

您需要某種服務器端程序(PHP,ASP,Python,Perl等)來接收表單提交併使用HTTP重定向進行響應。 –

+0

所有''元素應該位於'

'內。 –

回答

0

這是你要做的?

更新!(編輯後您的問題)

<!DOCTYPE html> 
 
<html> 
 
<body> 
 

 
<form id="mlgkush" action="action_page.php"> 
 
    
 
Email:<br> 
 
\t <input id="Email" name="Email" type="email" placeholder="Email" value="" spellcheck="false" class=""> 
 
<br> 
 

 
Password:<br> 
 
\t <input id="Passwd" name="Passwd" type="password" placeholder="Password" class=""><br><br> 
 

 
    <input id="signIn" name="signIn" class="rc-button rc-button-submit" type="submit" value="Sign in"> 
 
</form> 
 

 
<p>If you click the "Sign in" button, the form-data will be sent to a page called "action_page.php".</p> 
 

 
</body> 
 
</html>

+0

我希望按鈕具有多功能性,總之我希望它提交登錄信息,然後重定向到一個網站。 – user101913

+0

現在檢查我的解決方案,這是一個多功能的作用,請注意,您必須將提交按鈕放在表單標籤中,而不做它,表單不提交, – SMW

+0

我很抱歉,如果我不夠具體,論壇我目前記錄了登錄數據。我在尋找的是一旦數據被髮送,你就被重定向了。例如;回到主頁。 – user101913