1.建Google表單->在回應的地方選取回應目的地->在傳送隔壁的...選取 取得預先填入的連結
https://docs.google.com/forms/d/e/1FAIpQLSd0-gXezB4hJW9JM5Uu41CBpI1dWILYcyUMpfZS-tKbGrKWCg/viewform?usp=pp_url&entry.780273280=Rex&entry.1887730314=2223445
藍色為表單序號。 紅色黃色為輸入的變數名稱,可以直接從上面改
2.以Google表單當作後端程式
(2)語法:
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
function formresponse() {
var m = document.forms["form1"]["name"].value; 找到格子然後取得裡面的值
var d = document.forms["form1"]["tel"].value;
//這邊設定的變數m,d是name,tel欄位,加入.value代表取得這個欄位的數值
if (m==null || m=="")
{
alert("姓名不可為空白!");
return false;
}
else if (d==null || d=="")
{
alert("電話不可為空白!");
return false;
}
else
{
var MySubmit = "https://docs.google.com/forms/d/e/1FAIpQLSd0-gXezB4hJW9JM5Uu41CBpI1dWILYcyUMpfZS-tKbGrKWCg//formResponse?usp=pp_url&entry.780273280=" + m + "&entry.1887730314=" + d;
var NewOpen = window.open(MySubmit);
}
https://docs.google.com/forms/d/e/1FAIpQLSd0-gXezB4hJW9JM5Uu41CBpI1dWILYcyUMpfZS-tKbGrKWCg/viewform?usp=pp_url&entry.780273280=12345&entry.1887730314=77777
}
</script>
</head>
<body>
<form name="form1" action="javascript:formresponse();">
Name: <input type="text" name="name"><br /> 暗紫色是顯示出來的 紫色是後端的
Address: <input type="text" name="tel"><br />
<input type="submit" value="Submit">
</form>
</body>
</html>
輸入表單的網頁太醜?-> https://materializecss.com/text-inputs.html
3. HTML Forms
(2)語法:
<form action="/action_page.php">
First name:<br>
<input type="text" name="firstname" value="Mickey">
<br>
Last name:<br>
<input type="text" name="lastname" value="Mouse">
<br><br>
<input type="submit" value="Submit">
</form>
沒有留言:
張貼留言