【发布时间】:2022-01-16 16:36:43
【问题描述】:
我正在构建一个调查表,它使用 HTML(也可以使用 javascript)收集学生的信息,并且在网上找到了几个示例,但似乎没有一个有效。调查表目前只选择这些:
调查应该选择所有选项(名字、姓氏、居住地、大学选择、专业、校园访问),我不知道如何解决这个问题。
这是调查和代码:
<h3> Senior Survey </h3>
<div class="w3-container">
<script type="text/javascript">
console.log("Prospective student form is about to be displayed.");
</script>
<form method="post" action="mailto:hernand_gabr@bentley.edu" method="GET" enctype="text/plain" name="seniorsurvey">
<table class="w3-table w3-blue" id="second-gradient">
<tr>
<td style="text-align: center";>
<p><b> Please enter your first and last names. </b></p>
<input type="text" id="firstname" maxlength="60" placeholder="First Name:"/>
<input type="text" id="lastname" maxlength="60" placeholder="Last Name:"/>
</td>
</tr>
<tr>
<td style="text-align: center";>
<p><b> Where do you live? </b></p>
<input type="radio" id="peru" name="radiobutton" value="Peru">
<label for="peru">Peru</label>
<input type="radio" id="southamerica" name="radiobutton" value="SA">
<label for="southamerica">South America</label>
<input type="radio" id="unitedstates" name="radiobutton" value="USA">
<label for="unitedstates">United States</label>
</td>
</tr>
<tr>
<td>
<fieldset style="text-align: center";>
<p><b> What were your other top college choices? </b></p>
<input type="checkbox" id="bentley" name="uni">
<label for="bentley">Bentley U.</label>
<input type="checkbox" id="brandeis" name="uni">
<label for="brandeis">Brandeis U.</label>
<input type="checkbox" id="boston" name="uni">
<label for="boston">Boston U.</label>
<input type="checkbox" id="babson" name="uni">
<label for="babson">Babson U.</label>
<input type="checkbox" id="northeastern" name="uni">
<label for="northeastern">Northeastern U.</label>
</fieldset>
</td>
</tr>
<tr>
<td style="text-align: center";>
<p><b> What is your prospective major? </b></p>
<select name="majors" id="majors">
<option value="un">undecided</option>
<option value="cis">Computer Information Systems</option>
<option value="fi">Finance</option>
<option value="acc">Accounting</option>
<option value="ci">Creative Industries</option>
<option value="mkt">Marketing</option>
</select>
<br>
</td>
</tr>
<tr>
<td style="text-align: center";>
<p><b> When do you plan to visit campus? </b></p>
<input type="date" id="start" name="visit-start" value="2021-10-25" min="2021-10-25" max="2030-12-31">
<br><br>
</td>
</tr>
<tr>
<td style="text-align: center";>
<button type="submit" value="Submit College Info"> Submit </button>
<button type="reset" value="Clear College Info"> Clear </button>
<br><br>
</td>
</tr>
</table>
</form>
</div>
【问题讨论】:
标签: javascript html forms post survey