将文本添加到html表单

时间:2013-04-05 17:55:10

标签: html forms

我正在尝试自己添加文本来描述一些表单中没有任何输入框的步骤。是否有可能做到这一点?应该只是文本的行是:

<p>For a new location please add an entry</p>

我在没有<p>标签的情况下尝试了它,但再次没有成功。抱歉,如果这看起来非常简单,但我在w3schools,这个网站或谷歌搜索中没有看到任何内容。

<form action="insert.php" method="post">
Name <input name="name" type="text">
<br>
Email address of user <input name="email" type="text">
<br>
Phone Number <input name="phone" type="text">
<br>
Town <input name="town" type="text">
<br>
County <select name="county">
<option>    Outside Ireland </option>
<option>    Antrim  </option>
<option>    Armagh  </option>
<br>
<p>For a new location please add an entry</p>
<br>
Name of New Location <input name="newlocation" type="text">
<br>
Name of Location <input name="location" type="text">
<br>
Link in Google Maps <input name="gmapslink" type="text">
<br>
<input type="submit">
</form>

2 个答案:

答案 0 :(得分:0)

你的意思是,在框中输入预设的文字?我相信这将是价值=“期望值:

离。 input name="town" value="Text Desired" type="text"

答案 1 :(得分:0)

您可以使用placeholder属性来完成此操作

<input
  type="text"
  name="ds_email"
  placeholder="Please, enter your e-mail here"
/>