R
Ronan Dodworth
Hi there
I'm having a little bit of a problem with my customvalidator control.
The problem is the javascript runs fine on my local webserver IIS but
not when I post it to the web hosting server. As it is client side
scripting I'm suprised that this is the case as I'm using the same
browser IE6 and the same machine to access both. I've included the
code below.
Can anyone help . I've tried lowering all the security settings for
intranet and local intranet but to no avail!
Cheers
Ronan
<%@ Page Language="C#" Debug="true" Trace="true"
Src="..\CodeBehind\LogIn.cs" Inherits="EST.LogIn" %>
<script runat="server">
void Submit_Click(Object sender, EventArgs e)
{
GetLogIn();
}
void Send_Click(Object sender, EventArgs e)
{
SendEmail();
}
</script>
<html>
<head>
<link href="..\StyleSheets\BSF.css" type="text/css"
rel="stylesheet" />
<script language="javascript" id="clientEventHandlersJS">
function cvEmailPassword_Validate(source, arguments)
{
alert(source.id);
if (document.all("txtEmail").value != ""
&& document.all("txtPassword").value != "")
{
arguments.IsValid = true;
}
else
{
arguments.IsValid = false;
}
}
function cvSendPassword_Validate(source, arguments)
{
alert(source.id);
if (document.all("txtSendEmail").value != ""
)
{
arguments.IsValid = true;
}
else
{
arguments.IsValid = false;
}
}
</script>
</head>
<body>
<form runat="server">
<table>
<tbody>
<tr>
<td>
Already registered? Log In here
</td>
</tr>
<tr>
<td>
<asp
anel id="Panel1" runat="server"
width="450px" Height="95px" BorderStyle="Solid"
BackColor="LightSkyBlue">
<div align="left">
<asp:Table id="Table1" runat="server"
Height="74px">
<asp:TableRow>
<asp:TableCell Width= "70px">
<asp:Label runat="server"
id="lblEmail">Email</asp:Label>
</asp:TableCell>
<asp:TableCell>
<asp:TextBox
runat="server" Height="22px" ID="txtEmail"></asp:TextBox>
</asp:TableCell>
<asp:TableCell>
<asp:RegularExpressionValidator ID="valEmailAddress"
ControlToValidate="txtEmail" ValidationExpression=".*@.*\..*"
ErrorMessage="Email address is invalid." Display="None"
EnableClientScript="true" Runat="server" />
</asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell>
<asp:Label runat="server"
id="lblPassword">Password</asp:Label>
</asp:TableCell>
<asp:TableCell>
<asp:TextBox
TextMode="Password" runat="server" Height="22px"
ID="txtPassword"></asp:TextBox>
</asp:TableCell>
<asp:TableCell></asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell>
<asp:Button runat="server"
id = "btnLogIN" Text="LogIn" OnClick= "Submit_Click" />
</asp:TableCell>
</asp:TableRow>
</asp:Table>
</div>
</asp
anel>
<asp:customvalidator id="cvEmailPassword"
runat="server" ErrorMessage="You need to enter an email address and
password." ClientValidationFunction="cvEmailPassword_Validate"
ControlToValidate="txtEmail"></asp:customvalidator>
</td>
</tr>
<tr>
<td>
<br />
</td>
</tr>
<tr>
<td>
Forgotton your password? Enter you email
address and click send.
</td>
</tr>
<tr>
<td>
<asp
anel id="Panel2" runat="server"
width="450px" Height="95px" BorderStyle="Solid"
BackColor="LightSkyBlue">
<div align="left">
<asp:Table id="Table2" runat="server"
Height="74px">
<asp:TableRow>
<asp:TableCell Width= "70px">
<asp:Label runat="server"
id="lblSendEmail">Email</asp:Label>
</asp:TableCell>
<asp:TableCell>
<asp:TextBox
runat="server" Height="22px" ID="txtSendEmail"></asp:TextBox>
</asp:TableCell>
<asp:TableCell></asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell>
<asp:Button runat="server"
id = "btnSend" Text="Send" OnClick= "Send_Click" />
</asp:TableCell>
</asp:TableRow>
</asp:Table>
</div>
</asp
anel>
<asp:customvalidator id="cvSendPassword"
runat="server" ErrorMessage="You need to enter a valid email address."
ClientValidationFunction="cvSendPassword_Validate"
ControlToValidate="txtSendEmail"
</tr>
</tbody>
</table>
<br />
<asp:Label id="lblErrMessage" runat="server"></asp:Label>
<!-- Insert content here -->
</form>
</body>
</html>
I'm having a little bit of a problem with my customvalidator control.
The problem is the javascript runs fine on my local webserver IIS but
not when I post it to the web hosting server. As it is client side
scripting I'm suprised that this is the case as I'm using the same
browser IE6 and the same machine to access both. I've included the
code below.
Can anyone help . I've tried lowering all the security settings for
intranet and local intranet but to no avail!
Cheers
Ronan
<%@ Page Language="C#" Debug="true" Trace="true"
Src="..\CodeBehind\LogIn.cs" Inherits="EST.LogIn" %>
<script runat="server">
void Submit_Click(Object sender, EventArgs e)
{
GetLogIn();
}
void Send_Click(Object sender, EventArgs e)
{
SendEmail();
}
</script>
<html>
<head>
<link href="..\StyleSheets\BSF.css" type="text/css"
rel="stylesheet" />
<script language="javascript" id="clientEventHandlersJS">
function cvEmailPassword_Validate(source, arguments)
{
alert(source.id);
if (document.all("txtEmail").value != ""
&& document.all("txtPassword").value != "")
{
arguments.IsValid = true;
}
else
{
arguments.IsValid = false;
}
}
function cvSendPassword_Validate(source, arguments)
{
alert(source.id);
if (document.all("txtSendEmail").value != ""
)
{
arguments.IsValid = true;
}
else
{
arguments.IsValid = false;
}
}
</script>
</head>
<body>
<form runat="server">
<table>
<tbody>
<tr>
<td>
Already registered? Log In here
</td>
</tr>
<tr>
<td>
<asp

width="450px" Height="95px" BorderStyle="Solid"
BackColor="LightSkyBlue">
<div align="left">
<asp:Table id="Table1" runat="server"
Height="74px">
<asp:TableRow>
<asp:TableCell Width= "70px">
<asp:Label runat="server"
id="lblEmail">Email</asp:Label>
</asp:TableCell>
<asp:TableCell>
<asp:TextBox
runat="server" Height="22px" ID="txtEmail"></asp:TextBox>
</asp:TableCell>
<asp:TableCell>
<asp:RegularExpressionValidator ID="valEmailAddress"
ControlToValidate="txtEmail" ValidationExpression=".*@.*\..*"
ErrorMessage="Email address is invalid." Display="None"
EnableClientScript="true" Runat="server" />
</asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell>
<asp:Label runat="server"
id="lblPassword">Password</asp:Label>
</asp:TableCell>
<asp:TableCell>
<asp:TextBox
TextMode="Password" runat="server" Height="22px"
ID="txtPassword"></asp:TextBox>
</asp:TableCell>
<asp:TableCell></asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell>
<asp:Button runat="server"
id = "btnLogIN" Text="LogIn" OnClick= "Submit_Click" />
</asp:TableCell>
</asp:TableRow>
</asp:Table>
</div>
</asp

<asp:customvalidator id="cvEmailPassword"
runat="server" ErrorMessage="You need to enter an email address and
password." ClientValidationFunction="cvEmailPassword_Validate"
ControlToValidate="txtEmail"></asp:customvalidator>
</td>
</tr>
<tr>
<td>
<br />
</td>
</tr>
<tr>
<td>
Forgotton your password? Enter you email
address and click send.
</td>
</tr>
<tr>
<td>
<asp

width="450px" Height="95px" BorderStyle="Solid"
BackColor="LightSkyBlue">
<div align="left">
<asp:Table id="Table2" runat="server"
Height="74px">
<asp:TableRow>
<asp:TableCell Width= "70px">
<asp:Label runat="server"
id="lblSendEmail">Email</asp:Label>
</asp:TableCell>
<asp:TableCell>
<asp:TextBox
runat="server" Height="22px" ID="txtSendEmail"></asp:TextBox>
</asp:TableCell>
<asp:TableCell></asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell>
<asp:Button runat="server"
id = "btnSend" Text="Send" OnClick= "Send_Click" />
</asp:TableCell>
</asp:TableRow>
</asp:Table>
</div>
</asp

<asp:customvalidator id="cvSendPassword"
runat="server" ErrorMessage="You need to enter a valid email address."
ClientValidationFunction="cvSendPassword_Validate"
ControlToValidate="txtSendEmail"
</td></asp:customvalidator>
</tr>
</tbody>
</table>
<br />
<asp:Label id="lblErrMessage" runat="server"></asp:Label>
<!-- Insert content here -->
</form>
</body>
</html>