This is a migrated thread and some comments may be shown as answers.

[Solved] Weird validation behavior

1 Answer 114 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
laura
Top achievements
Rank 1
laura asked on 25 Jun 2009, 03:41 PM
I am using the RadScheduler with advanced edit and insert forms.  I used the SchedulerDefaultForm from the demo site as my starting point and have changed quite a bit of it to get it to do what I want.  I have it wired up to use the javascript file that allows me to use recurrence and I've added some more fields.  I have the inserting, deleting, and editing (of both single occurrence and series) working just fine.

Everything is working fine except for the validation.  I have tried to strip out the validation that comes with the SchedulerDefaultForm (where the validation message is displayed as a tooltip) so that it matches the validation I'm using in the rest of my site.  I edited the javascript file to get rid of the tooltip functionality (commmented out the _initializeAdvancedFormValidators function) and I have most of it working.  For instance, when I don't fill in the Subject field and I exit the textbox or click "Save", the validator shows up like I want it to.  The problem has to do with the validators on the start and end date and time fields.  When I clear a date or time field and move out of the box, the validator shows up like I want it to.  However, when I click the "Save" button the validator disappears.  So if I try to save an appointment without a subject and start date, the subject validator displays but the start date validator does not, even though I'm using requiredFieldValidators for both.  In both cases, when I clear the field and move out of the textbox, the validator appears like it should.  It's only when I click "Save" that the problem occurs.

I know the validator is firing because when I fill out all required fields except the start date, I am still unable to submit the form.  However, no message appears indicating why I cannot submit the form.  

Another issue I am having is that I cannot get a validation summary to display anywhere on the page.  The setup I have is that I have a InsertEvent.ascx control and a DefaultSchedulerForm.ascx control inside of the InsertEvent.ascx control.  The save button is on the InsertEvent.ascx control and I would like my validation summary to be on the InsertEvent.ascx control.  However, even though validation is firing and the individual validators are displaying next to the fields, the validaiton summary does not display.  I have tried moving it to the DefaultSchedulerForm.ascx control and it still doesn't display.  I have checked my validation groups on everything and it all looks okay.  Any ideas?

1 Answer, 1 is accepted

Sort by
0
laura
Top achievements
Rank 1
answered on 25 Jun 2009, 04:43 PM
Nevermind!  I just solved my own problem - I forgot that the validation group was being set in the code behind of the controls.  So even though I was setting the validation group in the mark up and everything seemed to look okay, once I ran it the validation groups were getting messed up and that is why they were behaving weirdly.

Thanks anyway!


Tags
Scheduler
Asked by
laura
Top achievements
Rank 1
Answers by
laura
Top achievements
Rank 1
Share this question
or