This has got to be a simple question. I am a newbie to asp.net and haven't used html much either. I'm trying to do what is described at: but I get the following error on my DatePicker.aspx:
"Validation (XHTML 1.0 Transitional): Attribute 'onblur' is not a valid attribute of element 'body'."
I've created a calendar webform that will popup from a data entry form when a user clicks on a link to input a date value. I use Javascript to pop this window up using the code below in my data entry form:
<script language="javascript" type="text/javascript">
function calendarPicker(strField)
{
window.open('DatePicker.aspx?field=' + strField, 'calendarPopup', 'width=250,height=190,resizable=yes,left=560,top=720,model=yes');
}
</script>
I want the calendar popup window to be modal so that it is always on top, so I want to use onblur="this.window.focus();"> within the body tag, but it does not compile.
Can someone please tell me why I can't use this? I see many examples on the internet for using onblur in the body tag. Below is my DatePicker.aspx code:
<%@ Page Language="C#" AutoEventWireup="false" CodeFile="DatePicker.aspx.cs" Inherits="DatePicker" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html xmlns=" <head id="Head1" runat="server">
<title>Select a Date</title>
</head>
<body onblur="this.window.focus();">
<form id="DatePickerForm" method="post" runat="server" title="Select a Date">
<div align="center">
<asp:calendar id="Calendar1" runat="server" showgridlines="True" bordercolor="Black" OnDayRender="Calendar1_DayRender">
<todaydaystyle forecolor="White" backcolor="#FFCC66"/>
<selectorstyle backcolor="#FFCC66"/>
<nextprevstyle font-size="9pt" forecolor="#FFFFCC"/>
<dayheaderstyle height="1px" backcolor="#FFCC66"/>
<titlestyle font-size="9pt" font-bold="True" forecolor="#FFFFCC" backcolor="#990000"/>
<othermonthdaystyle forecolor="#CC9966"/>
</asp:calendar>
</div>
</form>
</body>
</html>
"Validation (XHTML 1.0 Transitional): Attribute 'onblur' is not a valid attribute of element 'body'."
I've created a calendar webform that will popup from a data entry form when a user clicks on a link to input a date value. I use Javascript to pop this window up using the code below in my data entry form:
<script language="javascript" type="text/javascript">
function calendarPicker(strField)
{
window.open('DatePicker.aspx?field=' + strField, 'calendarPopup', 'width=250,height=190,resizable=yes,left=560,top=720,model=yes');
}
</script>
I want the calendar popup window to be modal so that it is always on top, so I want to use onblur="this.window.focus();"> within the body tag, but it does not compile.
Can someone please tell me why I can't use this? I see many examples on the internet for using onblur in the body tag. Below is my DatePicker.aspx code:
<%@ Page Language="C#" AutoEventWireup="false" CodeFile="DatePicker.aspx.cs" Inherits="DatePicker" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html xmlns=" <head id="Head1" runat="server">
<title>Select a Date</title>
</head>
<body onblur="this.window.focus();">
<form id="DatePickerForm" method="post" runat="server" title="Select a Date">
<div align="center">
<asp:calendar id="Calendar1" runat="server" showgridlines="True" bordercolor="Black" OnDayRender="Calendar1_DayRender">
<todaydaystyle forecolor="White" backcolor="#FFCC66"/>
<selectorstyle backcolor="#FFCC66"/>
<nextprevstyle font-size="9pt" forecolor="#FFFFCC"/>
<dayheaderstyle height="1px" backcolor="#FFCC66"/>
<titlestyle font-size="9pt" font-bold="True" forecolor="#FFFFCC" backcolor="#990000"/>
<othermonthdaystyle forecolor="#CC9966"/>
</asp:calendar>
</div>
</form>
</body>
</html>