Hello, I have created a custom section in the umbraco backoffice, and I have difficulty getting asp.net validation controls to work in my forms. Here is an example of a Panel I add to an umbraco tabview:
I have tried all sorts of things and I just can't get the validators to operate either on the client side or the server side. Otherwise the form works fine.
I have not been able to find mention of such a problem anywhere, so maybe I am doing something wrong, but I've been trying for days and I would really appreciate some help.
I am using umbraco v 4.7.1 (Assembly version: 1.0.4281.20201).
It's possible to do validation, but I never tried it with client side validation in the Umbraco backoffice. If you make a textbox mandatory it also only checks validation server side. I created a package which uses server validation: http://our.umbraco.org/projects/backoffice-extensions/digibiz-email-form-with-tinymce. If you download the source on the source tab you can see how it's done.
Validators in backoffice application
Hello, I have created a custom section in the umbraco backoffice, and I have difficulty getting asp.net validation controls to work in my forms. Here is an example of a Panel I add to an umbraco tabview:
<umb:TabView ID="TabViewDetails" runat="server" Width="552px" Height="692px"/>
<asp:Panel ID="PanelDetails" runat="server">
<umb:Pane ID="detailsPane" runat="server">
<umb:PropertyPanel ID="priceProp" runat="server" Text="Price">
<asp:TextBox ID="price2" runat="server" CssClass="textField"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
ControlToValidate="price2" ErrorMessage="RequiredFieldValidator" ValidationGroup="main"
></asp:RequiredFieldValidator>
</umb:PropertyPanel>
</umb:Pane>
</asp:Panel>
In the code behind I set up the form and save button like this:
TabPage dataTab = TabViewDetails.NewTabPage("Details");
dataTab.Controls.Add(PanelDetails);
ImageButton saveButtonData = dataTab.Menu.NewImageButton();
saveButtonData.ValidationGroup = "main";
saveButtonData.CausesValidation = true;
saveButtonData.ID = "saveDetails";
saveButtonData.Click += new ImageClickEventHandler(saveButtonData_Click);
saveButtonData.AlternateText = "Save";
saveButtonData.ImageUrl = umbraco.GlobalSettings.Path + "/images/editor/save.gif";
I have tried all sorts of things and I just can't get the validators to operate either on the client side or the server side. Otherwise the form works fine.
I have not been able to find mention of such a problem anywhere, so maybe I am doing something wrong, but I've been trying for days and I would really appreciate some help.
I am using umbraco v 4.7.1 (Assembly version: 1.0.4281.20201).
Thank you.
It's possible to do validation, but I never tried it with client side validation in the Umbraco backoffice. If you make a textbox mandatory it also only checks validation server side. I created a package which uses server validation: http://our.umbraco.org/projects/backoffice-extensions/digibiz-email-form-with-tinymce. If you download the source on the source tab you can see how it's done.
Jeroen
is working on a reply...