Client side Validation in Custom dropdownlist in radscheduler

4 posts, 0 answers
  1. Kuldeep Singh
    Kuldeep Singh avatar
    1 posts
    Member since:
    Apr 2013

    Posted 08 May 2013 Link to this post


    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

  2. Plamen
    Admin
    Plamen avatar
    3080 posts

    Posted 13 May 2013 Link to this post

    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.
  3. Kuldeep
    Kuldeep avatar
    25 posts
    Member since:
    May 2013

    Posted 21 May 2013 Link to this post

    Hello,

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

    Regards, 
    Kuldeep
  4. Plamen
    Admin
    Plamen avatar
    3080 posts

    Posted 24 May 2013 Link to this post

    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.
Back to Top