Welcome Guest Search | Active Topics | Sign In | Register

Validation for datepicker Options
handii
Posted: Saturday, June 21, 2008 7:50:12 PM
Rank: Newbie
Groups: Member

Joined: 5/5/2008
Posts: 9
I am trying to add requiredfiledvalidator to date picker, however when I set ControlToValidate property of requiredfiledvalidator it doesn't seem to work with eo web date picker, how can I make this control a required filed?
eo_support
Posted: Sunday, June 22, 2008 10:16:35 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,221
Hi,

The DatePicker does work with RequiredFieldValidator. We verified that with a simple test page with a DatePicker, a RequiredFieldValidator and a Button. Can you try the same and see if it works? Make sure you have the latest version.

Thanks
Posted: Monday, June 30, 2008 10:48:54 AM
Rank: Member
Groups: Member

Joined: 4/18/2008
Posts: 19
When the DatePicker control and the ASP RequiredFiledValidator are in the same web user control (.ascx), the validation works. However, if you put the web user control that contains the DatePicker in a .aspx page and have the RequiredFiledValidator on the .aspx page as well then a runtime exception is raised during the loading of the page.

Code example:

in a .aspx if you have a web user control and the req field validator, an exception occurs:
<tr>
<td>
<syn:DatePicker ID="xxxDatePicker" Runat="server"/>
</td>
<td>
<asp:RequiredFieldValidator ID="xxxxRequiredFieldValidator" ControlToValidate="xxxDatePicker" Display="Static"
Enabled="true" ErrorMessage="xxxxxx" runat="server">
</asp:RequiredFieldValidator>
</td>
</tr>



meanwhile, if the required field validator is in the web user control it works fine.

I would like to be able to have the validator outside of the control

eo_support
Posted: Monday, June 30, 2008 11:10:57 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,221
James Gemma wrote:
However, if you put the web user control that contains the DatePicker in a .aspx page and have the RequiredFiledValidator on the .aspx page as well then a runtime exception is raised during the loading of the page.


I believe that is very normal. You would get the same error if you were to use the standard ASP.NET TextBox. Basically the validator only works with controls that are within the same naming container. Technically it is possible to make it to work on other scenario as well, but in our opinion it would make much more sense to have our controls to be consistent with standard ASP.NET.


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.