Tag - JavaScript

Get geo location data using HTML5 & JavaScript

In case you are using Google Chrome you will have to enable getting location by the following steps:Open Google Chrome > on the top right click on the vertical 3 dots then select SettingsAt the bottom click Show advanced settingsIn the "Privacy" section, click Content settingsIn the dialog that appears, scroll down to the...

Show alert or run JavaScript function after showing the appointment popup in DevExpress using VB.NET

You should handle the CustomJSProperties event and add in properties collection the script which you are going to run it.Please find below server side code:Dim script As String = Nothing Dim disablePopup As Boolean = falseProtected Sub ASPxScheduler1_AppointmentFormShowing(sender As Object, e As AppointmentFormEventArgs) Handles ASPxScheduler1.AppointmentFormShowinge.Container = New...

Custom validator scrolls page to the top in ASP.NET

If we add a ValidationSummary control to the page, its ValidationSummaryOnSubmit function invokes “window.scrollTo(0,0)” when page is invalid. That’s why the page scrolls to the top.To workaround this issue, we can assign a function to window.scrollTo which do nothing, so that window.scrollTo(0,0) will not take effect. This workaround is appropriate for the pages which...

How to disable some context menu items on Telerik TreeView

There is an event named "OnClientContextMenuShowing" for Rad Treeview that calls javascipt function and passes 2 arguments "sender, args".The Args parameter contains The current selected TreeNode and Context Menu Items.You can enable or disable any Context menu item based on any attributes for the Current Selected Tree Node.Here is a code snippet for the...

JavaScript regular expression to match a comma delimited list

This method uses the JavaScript String's match() method to parse a comma delimited list and show its content in a Panel control.You can try it here http://jsfiddle.net/38tXU/function parseList(list) { var reg = list.match(/\w+(,\w+)*/g); document.getElementById('pnl').innerHTML = 'Total length:' + reg.length + '<br />'; for (var i =...