48 lines
1.5 KiB
HTML
48 lines
1.5 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>Local Site — Form</title>
|
|
<link rel="stylesheet" href="assets/site.css">
|
|
</head>
|
|
<body>
|
|
<header>
|
|
<h1>Form Page</h1>
|
|
<nav><a href="index.html">Home</a></nav>
|
|
</header>
|
|
<main>
|
|
<h2>GET form (submits to form-target.html)</h2>
|
|
<form action="form-target.html" method="get">
|
|
<label>Name: <input name="name" value="Alice"></label>
|
|
<label>Age: <input name="age" value="30"></label>
|
|
<button type="submit">Submit GET</button>
|
|
</form>
|
|
|
|
<h2>POST form (submits to form-target.html)</h2>
|
|
<form action="form-target.html" method="post">
|
|
<label>Comment: <input name="comment" value="hello"></label>
|
|
<button type="submit">Submit POST</button>
|
|
</form>
|
|
|
|
<h2>Form with enctype=multipart/form-data</h2>
|
|
<form action="form-target.html" method="post" enctype="multipart/form-data">
|
|
<label>File: <input type="file" name="upload"></label>
|
|
<button type="submit">Submit multipart</button>
|
|
</form>
|
|
|
|
<h2>Form targeting a new window</h2>
|
|
<form action="form-target.html" method="get" target="_blank">
|
|
<label>Q: <input name="q" value="search"></label>
|
|
<button type="submit">Submit to new window</button>
|
|
</form>
|
|
|
|
<h2>Form targeting an iframe</h2>
|
|
<form action="form-target.html" method="get" target="form-frame">
|
|
<label>R: <input name="r" value="x"></label>
|
|
<button type="submit">Submit to iframe</button>
|
|
</form>
|
|
<iframe name="form-frame" width="100%" height="120"></iframe>
|
|
</main>
|
|
</body>
|
|
</html>
|