我正在构建一个包含多个字段的表单,并将其放置在表格中以便于阅读。我想在表单内有一个下拉菜单,但是使用“选择/选项”标签,我总是在整个表单之前或之后都有下拉菜单。我能怎么做?这里有一个例子:
document.write('name "Addrow" <form action="xxxxxx.php?Mode=ADD" method="POST" enctype="multipart/form-data">')
document.write('<table width="900"><th width="250"></th><th width="650"></th>')
document.write('<TR>')
document.write('<TD>Codice evento:</td>')
document.write('<TD><input type="text" name="ID_evcls" maxlength="10" size="10"></td>')
document.write('</TR>')
document.write('<TR>')
document.write('<TD>Tipo evento:</td>')
document.write('<TD><input type="text" name="ID_tipoev" maxlength="5" size="10"></td>')
document.write('</TR>')
document.write('<TR>')
document.write('<TR>')
document.write('<TD>Titolo:</td>')
document.write('<TD><input type="text" name="TitEv" maxlength="35" size="35"></td>')
document.write('</TR>')
document.write('<TR>')
document.write('<TR>')
document.write('<TD>Descrizione:</td>')
document.write('<TD><input type="text" name="Descr" maxlength="150" size="75"></td>')
document.write('</TR>')
document.write('<TR>')
document.write('<TR>')
document.write('<TD>Data manifestazione:</td>')
document.write('<TD><input type="date" name="DataEv"></td>')
document.write('</TR>')
document.write('<TR>')
document.write('<TR>')
document.write('<TD>Luogo manifestazione:</td>')
document.write('<TD><input type="text" name="PlacEv" maxlength="25" size="25"></td>')
document.write('</TR>')
document.write('<TR>')
document.write('<TR>')
document.write('<TD>Nazione:</td>')
document.write('<TD><input type="text" name="NatEv" maxlength="3" size="3" value="ITA"></td>')
document.write('</TR>')
document.write('<TR>')
document.write('<TD>Immagine da utilizzare (JPEG):</td>')
document.write('<TD><input type="file" name="userfile"accept="image/jpeg"></td>')
document.write('</TR>')
document.write('</table>')
fn_buildchooseeventclass()
document.write('<input type="submit" value="Conferma inserimento">')
document.write('</form>')
}
function fn_buildchooseeventclass() {
document.write('<select name="carlist" form="Addrow">')
document.write('<option value="volvo">Volvo</option>')
document.write('<option value="saab">Saab</option>')
document.write('<option value="opel">Opel</option>')
document.write('<option value="audi">Audi</option>')
document.write('</select>')
}
</script>
</body>
</html>