这是一个现有的 Visual Studio 2003 项目(用 VB 编写)。有一个输入表单,其中包含许多字段,包括一个due date
字段。此字段是根据Reason type
下拉列表中选择的值填充的,它也是可编辑的。最近,我不得不禁用该due date
字段,以便无法更改填充的值(基于登录的用户)。我面临的问题是,当单击提交按钮时,会打开一个 IE 弹出窗口,并且“到期日期”字段中的值消失并变为空白。
Private Sub btnSubmitOrdersTab_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmitOrdersTab.Click
If Not Me.txtPRCEmail.Value.Length = 0 Or Not hPRCEmail.Value.Length = 0 Then
SubmitClick()
Else
RegisterStartupScript("PRCEmail", "<script language=javascript>window.open (""" & CType(Application("cBaseURL"), String) & "administration/supervisors/Orders/prc_email_reason.aspx"",null,""height=200,width=400,status=yes,toolbar=no,menubar=no,location=no"");</script>")
End If
End Sub
我试图在函数due date
之前使用 获取 的值,但它是空白的。RegisterStartupScript()
duedatevalue = Me.txtDueDate.Value
有什么方法可以防止该due date
字段变为空白。due date
如果该字段未禁用,这不是问题。
这是我从onload
事件中调用的 Java Script 函数<body>
以禁用到期日期。
function DisableDueDate()
{
if (udisable == "true")
document.getElementById("divduedate").setAttribute('disabled',true);
else
document.getElementById("divduedate").setAttribute('disabled',false);
}
我使用 disable 的原因是因为到期日期在<td>
标签中,旁边有一个 gif(不是服务器控件),单击时会弹出一个日历,以便用户选择日期。我希望禁用标签的全部内容 -<td>
包括 gif。