Last post Apr 20, 2005 06:47 PM by Nocturnal
Apr 20, 2005 01:53 PM|tinky_lou|LINK
Hi, I have a one-page custom module that accepts input for a survey. I have a number of asp.net requiredfieldvalidators on the page.
example of one of my validators:
<asp:RequiredFieldValidator id="RequiredFieldValidator6" runat="server" ErrorMessage="<li>Please enter a fax number"
When the user hits submit
<asp:Button causesvalidation="True" id="btnSave" runat="server" Width="69px" Text="Save" CommandName="savedealer"></asp:Button>
a function is called that writes the record away, hides the panel the form is on, and unhides a thank you message.
As I hit submit, I can see the validators are firing ... but the function is still run.
I can "stop" this by putting server-side validations in there, but I don't want to. The RequiredFieldValidator *should* be enough.
I've done many, many little modules this way - in DNN2 I didn't see this issue ever, so I don't know if it's perhaps a change. I didn't see anything related in the Module Developer's Guide.
Will appreciate any pointers ... Thanks!
Apr 20, 2005 05:18 PM|tinky_lou|LINK
Actually - very silly - if page.IsValid check was missing in the event handler for the button click.
Don't worry about it any more - just leaving this here in case someone else needs it.
Apr 20, 2005 06:47 PM|Nocturnal|LINK