Last post Sep 08, 2017 05:53 AM by Zhi Lv - MSFT
Aug 09, 2017 02:20 PM|BerrySmith|LINK
I have 2 drop down list where it shows data like
Week 4 Oct 2010
same format in both the drop downs
Now I want to validate on the selection of drop down list when end date is less than start date
then I want to alert an error that start date should be less than end date.
How to validate the function?
Aug 09, 2017 02:35 PM|mgebhard|LINK
As explained in your other threads, Week 4 Oct 2010, is not a standard date format. You need to rethink the approach. A few ideas...
If you are reluctant to change, then you'll need to parse the string, Week 4 Oct 2010, into a format where a comparison can be made.
var startWeek = "Week 4 Oct 2010"
var startWeekParts = startWeek.split(" ");
var value = parseInt(startWeekParts + startWeekParts);
Sep 08, 2017 05:53 AM|Zhi Lv - MSFT|LINK
You could use the RadComboBox's OnClientSelectedIndexChanged
event, in this event, you could use the following code to get the RadComboBox selected value:
var ddlCountry = $find('<%=ddlCountry.ClientID %>');
var countryValue = ddlCountry.get_selectedItem().get_value();
var countryText = ddlCountry.get_selectedItem().get_text();
split() Method to split the Text and create two date. Finally, compare the date and according to the result to display the validation message.