M
MatsL
I have a simple test form with a panel and default button defined,
textbox, RequiredFieldValidator. If i open the form and press enter the
RequiredFieldValidator will prevent the form to be submittet but if i
press enter a second time the form will be submitted and
RequiredFieldValidator will be ignored. Is this by design? or how do i
prevent the form to be subbmitted a second time
// Mats
<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form defaultfocus="TextBox1" id="form1" runat="server">
<div>
<asp
anel ID="Panel1" runat="server" DefaultButton="Button1"
Height="218px" Width="428px">
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:Button ID="Button1" runat="server" Text="Button"
ValidationGroup="1" />
<asp:RequiredFieldValidator ID="RequiredFieldValidator1"
runat="server" ControlToValidate="TextBox1"
ErrorMessage="RequiredFieldValidator"
ValidationGroup="1"></asp:RequiredFieldValidator></asp
anel>
</div>
</form>
</body>
</html>
textbox, RequiredFieldValidator. If i open the form and press enter the
RequiredFieldValidator will prevent the form to be submittet but if i
press enter a second time the form will be submitted and
RequiredFieldValidator will be ignored. Is this by design? or how do i
prevent the form to be subbmitted a second time
// Mats
<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form defaultfocus="TextBox1" id="form1" runat="server">
<div>
<asp
Height="218px" Width="428px">
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:Button ID="Button1" runat="server" Text="Button"
ValidationGroup="1" />
<asp:RequiredFieldValidator ID="RequiredFieldValidator1"
runat="server" ControlToValidate="TextBox1"
ErrorMessage="RequiredFieldValidator"
ValidationGroup="1"></asp:RequiredFieldValidator></asp
</div>
</form>
</body>
</html>