是否可以在 html 中制作联系表?
Is it possible to make a contact form in html?
我想制作一个网站,其中包含访问者将填写的问卷。这是我拥有的:
<html>
<head>
</head>
<body>
<form method="post" action="index.php">
<label>Name:</label>
<input name="name" placeholder="Name">
<label>Email:</label>
<input name="email" type="email" placeholder="Email">
<label>Price:</label>
<select name="price" option="Free,1p - £1,£1 - £5,£5 - £10,£10 - £20,£20+"
<label>Comment:</label>
<textarea name="message" placeholder="Do you want to say anything else?"></textarea>
<input id="submit" name="submit" type="submit" value="submit">
</form>
</body>
</html>
大部分都有效,但出于某种原因我无法让下拉菜单正常工作。你能帮忙吗?
您的 <select>
元素有误。您需要 child <option>
。看这里:https://www.w3schools.com/html/html_form_elements.asp
所以,更像是:
<select name="price">
<option value="0">Free</option>
<option value="0to1">1p - £1</option>
<option value="1to5">£1 - £5</option>
<!-- etc -->
</select>
我想制作一个网站,其中包含访问者将填写的问卷。这是我拥有的:
<html>
<head>
</head>
<body>
<form method="post" action="index.php">
<label>Name:</label>
<input name="name" placeholder="Name">
<label>Email:</label>
<input name="email" type="email" placeholder="Email">
<label>Price:</label>
<select name="price" option="Free,1p - £1,£1 - £5,£5 - £10,£10 - £20,£20+"
<label>Comment:</label>
<textarea name="message" placeholder="Do you want to say anything else?"></textarea>
<input id="submit" name="submit" type="submit" value="submit">
</form>
</body>
</html>
大部分都有效,但出于某种原因我无法让下拉菜单正常工作。你能帮忙吗?
您的 <select>
元素有误。您需要 child <option>
。看这里:https://www.w3schools.com/html/html_form_elements.asp
所以,更像是:
<select name="price">
<option value="0">Free</option>
<option value="0to1">1p - £1</option>
<option value="1to5">£1 - £5</option>
<!-- etc -->
</select>