使用此示例代码,我正在尝试启用/禁用“arrdatfrom”字段。但是,一旦禁用此文本字段,我就无法重新启用它。当用户单击“刷新”按钮时,将执行以下功能。我建立了这个小演示只是为了证明我已经尝试了很多方法来做到这一点。有任何想法吗?
function showBooking() {
var d = new Date()
formvals.arrdatefrom = document.getElementById("arrdatfrom").value
formvals.arrdatethru = document.getElementById("arrdatthru").value
formvals.depdatefrom = document.getElementById("depdatfrom").value
formvals.depdatethru = document.getElementById("depdatthru").value
formvals.bookname = document.getElementById("bookname").value
formvals.peakroomfrom = document.getElementById("peakroomfrom").value
formvals.peakroomthru = document.getElementById("peakroomthru").value
formvals.peakattendfrom = document.getElementById("peakattendfrom").value
formvals.peakattendthru = document.getElementById("peakattendthru").value
alert (' ngs.hta ready to enable')
document.getElementById("arrdatfrom").enabled = 'true'
alert ('ngs.hta in showBooking!! disable. ')
document.getElementById("arrdatfrom").disabled = 'true'
...