Javascript 下拉框未通过php发送表单数据

Javascript 下拉框未通过php发送表单数据,javascript,php,html,Javascript,Php,Html,这可能是我错过的一些简单的东西。 我有一个html页面,上面有一个表单: <form action="http://URL/mailer.php" id="contact_form" method="post"> 因此,我认为如果我添加$boardtype&$boardstyle,它将从下拉框中提取信息,但是它不会为这两个字段输入任何数据 { Bill Gates John Scott Email@gmail.com 039393920 } 邮件下面应该有两个项目 我很抱歉这

这可能是我错过的一些简单的东西。 我有一个html页面,上面有一个表单:

<form action="http://URL/mailer.php" id="contact_form" method="post">
因此,我认为如果我添加
$boardtype
&
$boardstyle
,它将从下拉框中提取信息,但是它不会为这两个字段输入任何数据

{ Bill Gates
John Scott
Email@gmail.com


039393920
}
邮件下面应该有两个项目

我很抱歉这么长时间,我只是想尽可能多地输入信息。在这里,另一个有效的表单数据的格式如下:

<input type="text" name="referred" id="referred" value="" class="requiredField" onblur="if(this.value == '') { this.value = 'Referred By'; }" onfocus="if(this.value == 'Referred By') { this.value = ''; }" style="color: #FFFFFF; border: 1px solid #000000; padding-left: 4px; padding-right: 4px; padding-top: 1px; padding-bottom: 1px; background-color: #3399CC" size="37" /></td>

<input type="text" name="first" id="first" value="" class="requiredField" onblur="if(this.value == '') { this.value = 'First Name'; }" onfocus="if(this.value == 'First Name') { this.value = ''; }" style="color: #FFFFFF; border: 1px solid #000000; padding-left: 4px; padding-right: 4px; padding-top: 1px; padding-bottom: 1px; background-color: #3399CC" size="37" /></td>


表单的其余部分的格式与此相同,无需发布其他文本框

php实际读取的是具有指定名称的元素

所以
$boardstyle=$\u POST[“boardtype”]
表示php将查找名为
'boardtype'
的元素

因此,将name属性添加到
选择中

<select id="boardtype" name="boardtype">
.
.
.

.
.
.

您需要在标签上设置一个名称,如下所示:我错过了name=“boardtype”这是一个新手犯的错误,哈哈,谢谢!非常感谢。真不敢相信我错过了!我已经有了id=“boardtype”,但我没有name=“boardtype”,只要我添加了>name=“boardtype”,它就工作得很好!!!非常感谢你!我真不敢相信我错过了那个lol
{ Bill Gates
John Scott
Email@gmail.com


039393920
}
<input type="text" name="referred" id="referred" value="" class="requiredField" onblur="if(this.value == '') { this.value = 'Referred By'; }" onfocus="if(this.value == 'Referred By') { this.value = ''; }" style="color: #FFFFFF; border: 1px solid #000000; padding-left: 4px; padding-right: 4px; padding-top: 1px; padding-bottom: 1px; background-color: #3399CC" size="37" /></td>

<input type="text" name="first" id="first" value="" class="requiredField" onblur="if(this.value == '') { this.value = 'First Name'; }" onfocus="if(this.value == 'First Name') { this.value = ''; }" style="color: #FFFFFF; border: 1px solid #000000; padding-left: 4px; padding-right: 4px; padding-top: 1px; padding-bottom: 1px; background-color: #3399CC" size="37" /></td>
<select id="boardtype" name="boardtype">
.
.
.