我试图添加功能以在用户从选择列表中选择包含值是而不使用提交时提交的表单按钮。这里是链接:http://juiceme.no/phpmail/。我试图在输入选择框中选择是或否选项后尝试发送邮件
<?php
//if "email" variable is filled out, send email
if (isset($_REQUEST['email'])) {
//Email information
$admin_email = "[email protected]";
$email = $_REQUEST['email'];
$subject = $_REQUEST['subject'];
$select = $_REQUEST['select'];
//send email
mail($admin_email, "$subject", $select, "From:" . $email);
//Email response
echo "Thank you for contacting us!";
}
//if "email" variable is not filled out, display the form
else {
?>
<form method="post">
Email: <input name="email" type="text" /><br />
Subject: <input name="subject" type="text" /><br />
Message:<br />
<!--<textarea name="comment" rows="15" cols="40"></textarea><!-->
<select id="select" name="select">
<option value="yes">More View</option>
<option value="yes">Yes</option>
<option value="NO">No</option>
</select>
<br />
<input type="submit" value="Submit" />
</form>
<?php
}
?>
的问题是,我不能够当用户选择在选择框中包含是选择提交表单。
使用条件语句和检查,如果它等于什么 –
顺便说一句,你标记为javascript和angularjs和jQuery没有代码支持题。 –
好,感谢的建议,我不需要提交按钮,条件语句是当值选择@@谢谢,我很高兴与你的建议 –