Javascript 从下拉列表中选择其他选项时激活文本框

Javascript 从下拉列表中选择其他选项时激活文本框,javascript,php,html,Javascript,Php,Html,我需要有关我的电子邮件订单的帮助 当有人选择“自行收集”选项时,它将为用户激活日期和时间选择。我想选择日期和时间作为必填字段。我怎么做 也请访问 添加以下代码后,无法发送电子邮件 <div class="section colm colm6"> <label class="field select"> <select name="select" id="select"> <option value="">Delivery

我需要有关我的电子邮件订单的帮助

当有人选择“自行收集”选项时,它将为用户激活日期和时间选择。我想选择日期和时间作为必填字段。我怎么做

也请访问

添加以下代码后,无法发送电子邮件

   <div class="section colm colm6">
   <label class="field select">
   <select name="select" id="select">
    <option value="">Delivery Methods...</option>
                                    <option value="Register-Mail">     Register Mail </option>
                                    <option value="Normal-Mail"> Normal Mail </option>
                                    <option value="Self-Collection">   Self-Collection </option>
                                    <option value="QVOO-Delivery"> QVOO Delivery (+$8) </option>
   </select>
    <i class="arrow double"></i>                    
                            </label>  
  </div>


                </div><!-- end frm-row section -->
                <center><strong><p>**WE will re-confirm your self collection date once your order arrives</p></strong></center>
       <div class="section colm colm6">
                   <label class="field select">
                       <select id="Self-Collection" name="Self-Collection" disabled='disabled'>
                           <option value="">Self Collection Date...        </option>
                           <option value="Monday After 7pm">Monday After 7pm</option>
                           <option value="Wednesday After 7pm"> Wednesday After 7pm </option>
                           <option value="Friday After 7pm"> Friday After 7pm </option>
                           <option value="Saturday Day 9am-2pm"> Saturday Day 9am-2pm </option>
                           <option value="Sunday 9am-2pm"> Sunday 9am-2pm </option>
                       </select>
                       <i class="arrow double"></i>                    
                   </label>  
                  </div>


      $(document).ready(function () {
     $("#select").change(function () {
    if ($(this).find("option:selected").val() == "Self-Collection") {
        $("#Self-Collection").removeAttr("disabled")
    } else {
        $("#Self-Collection").attr("disabled","disabled")
    }
     });
    });

交付方式。。。
挂号信
普通邮件
自选
QVOO交付(+8美元)
**一旦您的订单到达,我们将重新确认您的自助收款日期

自我收集日期。。。 周一下午7点后 星期三下午7点后 星期五下午7点后 星期六上午9点至下午2点 星期日上午9点至下午2点 $(文档).ready(函数(){ $(“#选择”)。更改(函数(){ if($(this).find(“选项:选中”).val()=“自收集”){ $(“#自收集”).removeAttr(“已禁用”) }否则{ $(“自我收集”).attr(“禁用”、“禁用”) } }); });
您是否尝试在选择按钮上放置所需属性

我已经编辑了我的答案。请检查。

$(document).ready(function () {
  $("#select").change(function () {
  if ($(this).find("option:selected").val() == "Self-Collection") {
    $("#Self-Collection").removeAttr("disabled");
    $("#Self-Collection").attr("required","true");
  } else {
    $("#Self-Collection").attr("disabled","disabled");
    $("#Self-Collection").removeAttr("required");
  }
  });
});

是的,我已经试过了。不变。。我需要它被要求时,只有激活的第一选择。伟大的它的作品。但不知何故,在添加代码后提交订单时遇到了问题。哦,是的,解决了无法发送电子邮件的错误。只是一些html代码错误。你的代码工作得很好。谢谢