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

Client-side validation issue (Should be simple?)

1 Answer 33 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Kevin Price
Top achievements
Rank 1
Kevin Price asked on 25 Jun 2010, 08:20 PM
Consider the following javascript (inside schedulerFormCreated function for advanced form example):

 $telerik.$(".rsAdvResourceValue").each(function(i) { 
                    if (this.id.match("cboPrimaryClient") != null) 
                        priCliCbo = this.id; 
                }); 
                if (priCliCbo != null) { 
                    priCliCboBox = $find(priCliCbo); 
                    $telerik.$(".rsAdvEditSave").bind("click", function(e) { 
                    priCliCboBox = $find(priCliCbo); 
                        if (priCliCboBox.get_selectedItem() == null) { 
                            alert("Please select a Primary Client"); 
                            return false; 
                        } 
                        if (priCliCboBox.get_selectedItem().get_text() == "") { 
                            alert("Please select a Primary Client"); 
                            return false; 
                        } 

This works GREAT for the one dropdown box on the page, but NO MATTER WHAT I try to get access to the textboxes on there - I get null. I have even firebugged the id's and tried direct references - nothing. Also - attempted to add regular ASP:RequiredFieldValidators in the ascx as those that exist in the sample. This is great, until they validate and the control comes back blank with left pointing arrows in the date picker boxes. I have looked at every example I can find via search and don't seem to see anywhere that simple client-side validation can be done with this.

1 Answer, 1 is accepted

Sort by
0
Kevin Price
Top achievements
Rank 1
answered on 25 Jun 2010, 09:09 PM
Ok - guess I just needed to make a forum post to make it work? :)
Stepped back a bit and used document.getElementById instead of $find and seems to work just fine. Still kinda curious as to why.


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