I wrote a javascript code to display the next date of a specific calendar
My Function
function verificaDataReferencia(mensagem)
{
if(document.getElementById("txtDataReferencia1Hidden") == null || document.getElementById("txtDataReferencia2Hidden") == null || document.getElementById("ddlDataPub") == null || document.getElementById("txtDataRefInfo") == null)
var objtxtDataReferencia1Hidden = document.getElementById("txtDataReferencia1Hidden").value;
var objtxtDataReferencia2Hidden = document.getElementById("txtDataReferencia2Hidden").value;
> Breakpoint var objtxtDataArquivo = document.getElementById("ddlDataPub").value;
var mensagem = document.getElementById("txtDataRefInfo").value;
if((objtxtDataReferencia1Hidden == objtxtDataArquivo) || (objtxtDataReferencia2Hidden == objtxtDataArquivo))
{
var x = alert(mensagem);
return x;
}
}
Html
<asp:TextBox style="Z-INDEX: 112; POSITION: absolute; TOP: 9px; LEFT: 572px" id="txtDataReferencia1Hidden"
runat="server" CssClass="inputLabel" Width="15" Height="15px"></asp:TextBox>
<asp:TextBox style="Z-INDEX: 113; POSITION: absolute; TOP: 9px; LEFT: 606px" id="txtDataReferencia2Hidden"
runat="server" CssClass="inputLabel" Width="14" Height="14px"></asp:TextBox>
the problem is that the page is running well in chrome but when i run my application in IE it throw an error
0x800a138f - JavaScript runtime error: Unable to get property 'value' of undefined or null reference
please help me to overcome from this problem.
private void Page_Load(object sender, System.EventArgs e)
{
if(! IsPostBack)
{
txtNomePortugues.SetFocus();
BO.Pasta pasta = new BO.Pasta(CodPasta);
if (CodigoArquivo == 0 && !IsJustificativa && pasta.EnviaEmail)
btnGravar.Attributes.Add("onclick", "verificaDataReferencia(); confirmaEnvioEmail('" + GetString("Mensagem_Confirmacao_Alerta_Arquivos") + "');");
else
btnGravar.Attributes.Add("onclick", "verificaDataReferencia();");