這是一個現有的Visual Studio 2003項目(用VB編寫)。有一個輸入表格,其中包含許多字段,包括due date
字段。根據在Reason type
下拉列表中選擇的值,該字段被激活並且它也是可編輯的。最近,我必須禁用due date
字段,以便填充值無法更改(基於登錄的用戶)。我面臨的問題是當點擊提交按鈕時,會打開一個IE彈出窗口,並且`截止日期'字段中的vlaue消失並變爲空白。單擊提交時,輸入字段爲空
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
我嘗試了使用duedatevalue = Me.txtDueDate.Value
的RegisterStartupScript()
功能之前拿到due date
的價值,但它是空的。
有什麼辦法可以阻止due date
字段變空白。如果due date
字段未被禁用,則這不是問題。
這是我從onload
事件<body>
事件中調用的Java腳本函數禁用截止日期。
function DisableDueDate()
{
if (udisable == "true")
document.getElementById("divduedate").setAttribute('disabled',true);
else
document.getElementById("divduedate").setAttribute('disabled',false);
}
我使用禁用的原因是因爲截止日期是在<td>
標籤與旁邊一個GIF(而不是服務器控件),點擊時,使用戶可以選擇一個會彈出一個壓延沿日期。我希望禁用<td>
標記的全部內容(包括gif)。
我使用禁用的原因是因爲截止日期是在一個div標籤以及旁邊的一個gif(不是服務器控件),點擊時彈出一個日曆以便用戶可以選擇一個日期。我希望禁用div標記的全部內容 - 包括gif。 – stackuser