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

Client side Validation in Custom dropdownlist in radscheduler

3 Answers 71 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Kuldeep Singh
Top achievements
Rank 1
Kuldeep Singh asked on 08 May 2013, 01:43 PM

Hi Telerik Team,

I want to validate  custom resource collection fields on client side in radscheduler.
I have try some thing..
 function clientFormCreated(scheduler, args) {
            debugger;
            $(".rsAdvEditSave").bind({
                click: function () {
                    if (RadScheduler1_AdvancedInsertForm_ResTeacher.value == "-") {
                      //RadScheduler1 is scheduler ID
                        alert('Please select teacher !');
                        return false;
                    }
                   else if (RadScheduler1_AdvancedInsertForm_ResStudent.value == "-") {
                        alert('Please select Student !');
                    }
                }
            });
        }
please help.

Thanks,
Kuldee[p

3 Answers, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 13 May 2013, 10:43 AM
Hi,

 
Here is the code that should work for you:

function OnClientFormCreated(scheduler, args) {
               var $ = $telerik.$;
               $(".rsAdvEditSave").bind({
                   click: function () {
                       var RoomComboBox = $find($("[id$='Form_ResRoom']").attr("id"));
                       var UserComboBox = $find($("[id$='Form_ResUser']").attr("id"));
                       if (RoomComboBox.get_selectedItem().get_text() == "-") {
                           //RadScheduler1 is scheduler ID
                           alert('Please select teacher !');
                           return false;
                       }
                       else if (UserComboBox.get_selectedItem().get_text() == "-") {
                           alert('Please select Student !');
                       }
                   }
               });
           }


Hope this will be helpful.Regards,
Plamen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Kuldeep
Top achievements
Rank 1
answered on 21 May 2013, 09:00 AM
Hello,

This code not working properly,after select the item from the dropdown again it show the message.
Please update me.

Regards, 
Kuldeep
0
Plamen
Telerik team
answered on 24 May 2013, 08:02 AM
Hello Kuldeep,

 
I have tested it once again and it was working properly at my side-showing for each resource we have. Here is a video of my test. Please review it and let me know if I ma not testing properly or your case is somehow different.

Regards,
Plamen
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Scheduler
Asked by
Kuldeep Singh
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Kuldeep
Top achievements
Rank 1
Share this question
or