Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RequiredFieldValidator not working on deployed server

Status
Not open for further replies.

ggeorgiou01

Programmer
Apr 11, 2005
60
GB
Hi All,

I have a simple form, which contains a asp textbox and a requiredfieldvalidator, with a submit button.

I can run my website up locally and there is not a problem, and the form works like it should and displays an error message, if the field is left blank.

However... Once deployed to my live web server, the form behaves differently and postback's the page instead of displaying the error message...

Why is this happening ? ...I am really stomped on this one!

Thank you in advance,

George

 
No - Sorry I should have specified that it is on our intranet and not accessible through the net. Any ideas though ?

I have seen a couple of posts on google about people having simlar problems to mine, but have failed to find a solution to the problem.

G,
 
<div id="ProductDiv" runat="Server" class="productInfo">
<asp:label ID="NotificationLb" runat="server" Visible="false" CssClass="notification"></asp:label>
<asp:ValidationSummary ID="ValidationSummary1" runat="server" HeaderText="&nbsp;Fields highlighted in yellow and marked with an asterisk are mandatory fields, and must be completed." ValidationGroup="Product"/>
<div class="borderTwo" id="InformationTwoDiv" runat="server">
<br />
<table cellpadding="3" cellspacing="0" width="500px">
<tr>
<td style="width:125px">
&nbsp;&nbsp;Task&nbsp;Name:
</td>
<td>
<asp:Label id="TaskLb" runat="server" CssClass="label"></asp:Label>
</td>
</tr>
<tr>
<td>
&nbsp;&nbsp;Group:
</td>
<td>
<asp:Label id="GroupLb" runat="server" CssClass="label"></asp:Label>
</td>
</tr>
<tr id="ActionByTr" runat="server">
<td>
&nbsp;&nbsp;Actioned&nbsp;By:
</td>
<td>
<asp:Label id="ActionByLb" runat="server" CssClass="label"></asp:Label>
</td>
</tr>
<tr id="ActionDateTr" runat="server">
<td>
&nbsp;&nbsp;Actioned&nbsp;Date:
</td>
<td>
<asp:Label id="ActionDateLb" runat="server" CssClass="label"></asp:Label>
</td>
</tr>
<tr id="NotesTr" runat="server" visible="false">
<td valign="top">
<br />
&nbsp;&nbsp;Past&nbsp;Comments:
</td>
<td style="font-style:italic;color:Blue">
<br />
<asp:Label id="NotesLb" runat="server" CssClass="label"></asp:Label>
</td>
</tr>
<tr>
<td valign="top">
<br />
&nbsp;&nbsp;Comments:
<asp:RequiredFieldValidator id="NotesRfv" ControlToValidate="NotesTb" runat="server" ValidationGroup="Product" SetFocusOnError="True" Enabled="true" EnableClientScript="true">*</asp:RequiredFieldValidator>
</td>
<td>
<br />
<asp:TextBox ID="NotesTb" runat="server" TextMode="MultiLine" Font-Size="1.0em" Width="325px" Rows="5" MaxLength="500" CssClass="requiredField"></asp:TextBox>
</td>
</tr>
</table>
<br />

<table cellpadding="3" cellspacing="1" width="500px">
<tr>
<td colspan="4" style="height:5px"></td>
</tr>
<tr>
<td style="width:75px"></td>
<td align="center">
<asp:Button ID="CancelBtn" runat="server" Text="Cancel" CssClass="buttonRed" CausesValidation="false" OnClientClick='return confirm("Are you sure you want to Cancel ?");' OnClick="CancelBtn_Click" Font-Size="0.95em"/>
</td>
<td align="center">
<asp:Button ID="SubmitBtn" runat="server" Text="Reject" CssClass="buttonGreen" CausesValidation="true" OnClick="SubmitBtn_Click" Font-Size="0.95em" ValidationGroup="Product" />
</td>
<td style="width:75px"></td>
</tr>
<tr>
<td colspan="4" style="height:5px"></td>
</tr>
</table>
</div>
</div>


It all works locally on my machine, so I dont see why I shouldnt work on my deployment server!

Thanks for the help, ca8msm!
 
Code:
<script type="text/javascript">
<!--
var ctl00_ValidationSummary1 = document.all ? document.all["ctl00_ValidationSummary1"] : document.getElementById("ctl00_ValidationSummary1");
ctl00_ValidationSummary1.headertext = " Fields highlighted in yellow and marked with an asterisk are mandatory fields, and must be completed.";
ctl00_ValidationSummary1.validationGroup = "Product";
var ctl00_NotesRfv = document.all ? document.all["ctl00_NotesRfv"] : document.getElementById("ctl00_NotesRfv");
ctl00_NotesRfv.controltovalidate = "ctl00_NotesTb";
ctl00_NotesRfv.focusOnError = "t";
ctl00_NotesRfv.validationGroup = "Product";
ctl00_NotesRfv.evaluationfunction = "RequiredFieldValidatorEvaluateIsValid";
ctl00_NotesRfv.initialvalue = "";
// -->
</script>
This section shows that the validation controls are outputting the correct javascript so that isn't the problem. It could be down to something else such as virus checkers, blockers etc that interfere with the browser.


____________________________________________________________
Mark,
[URL unfurl="true"]http://aspnetlibrary.com[/url]

Need help finding an answer? Try the Search Facility or read FAQ222-2244.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top