" Live as if you were to die tomorrow. Learn as if you were to live forever.. "
- Mahatma Gandhi

To Run Javascript On Generated PDF In NetSuite

Posted on November 24th, 2015 by Vijai Vaishnav

In NetSuite you can generate the pdf, along with that you can also add form elements in your document like text box, drop-down list, and radio buttons to make your pdf more interactive. Also you can run JavaScript’s on your generated pdf. Here in this tip you would come to know how to run it. […]

How to call a JavaScript function from an Applet?

Posted on November 24th, 2015 by Chetan Wadhwa

Sometimes there is a need to call JavaScript function from an applet.As both are the parts of an HTML page, in case we want our applet to communicate with browser then we call javascript function and then javascript communicate with browser. To call javascript function we first need plugin.jar which contains the classes needed for […]

Setting font size of text on Web View with the fixed height of Web View

Posted on November 24th, 2015 by Surbhi Garg

We can find out the height of the Text by   NSString *height = [_webViewstringByEvaluatingJavaScriptFromString:@” document.body.offsetHeight;”]; if([height floatValue] > _webView.frame.size.height) { [_htmlpage appendFormat:@”<html><body><div><a name=’a%d’><font size =’%f’%/>%@</a>”,_text,-(_readerView.frame.size.height*_webView.frame.size.width) /[heightfloatValue],x1]; [_htmlpage appendFormat:@”</div></body></html>”]; } This will set the font size of the text to smaller upto an extent.  

Notification between HTML page(JavaScript) and Objective C

Posted on November 24th, 2015 by Rinku Dahiya

If you want the execution control from HTML page to the objective C then use this :- Step 1 :- In HTML page search for the script tag(create new if it doesnt exist) and write this. <script type=”text/javascript” charset=”utf-8″> window.location = “anyName”; // It would act like NSNotification post notification as we use in core […]

API to Include Javascript/Css files for an usercontrol in DotNetNuke

Posted on November 24th, 2015 by Damodaranaidu Betha

I have tried to give the reference in the dotnetnuke module’s user control like as below. <script src=”Scripts/jquery-1.6.2.js” type=”text/javascript” /> It complied successfully.When I run  the application gave me 404 error. But the file is there in Project Scripts folder. I found that application is looking for script in localhost/dnn/…/Scripts/ jquery.ui.182.js path where the file […]

Different ways of creating dynamic controls in ASP.NET

Posted on November 24th, 2015 by Devi Das

There are different ways in which you can create dynamic control in ASP.NET. Here i have given 5 different ways for creating Dynamic controls.   1 : [By using JavaScript] ——————————   By using javascript you can create Dynamic controls. Code :         window.load = createDynamicControl;         function createDynamicControl()         {               document.write(“<input […]

Calling a Silverlight function from Javascript and vice versa.

Posted on November 24th, 2015 by Subrat Parichha

In this tip we will discuss how to call a Silverlight function from our Javascript code and also the reverse technique. All the javascript functions discussed here should belong on the same aspx page where the Silverlight control is present. Calling a Silverlight function from Javascript I have a class, say, ‘Common’ in my Silverlight […]

Creating And Using Global Variables In WinJS

Posted on November 23rd, 2015 by Nirmal Hota

Define a Global variable in WinJS – Can be declared in any exitsing global JS file in the project, to get the access through out the project. – default.JS file can also be a used to declare global variables. Syntax WinJS.Namespace.define(“<Namespace Name>”,{<variable name>: <valu>,});   Example WinJS.Namespace.define(“MyNameSpace”, { MyGlobalVariable: 1 , });   – The […]

Using PageMethods in ASP.NET

Posted on November 23rd, 2015 by Bhagirathi Panda

The PageMethods feature enables the using of code-behind page methods on the client side. This is easier and reliable to use and the main feature is it automatically validates the page parameters. Page Method Example ASPX <%@ Page Language=”C#” AutoEventWireup=”true” CodeFile=”PageMethods.aspx.cs” Inherits=”PageMethods” %> <!DOCTYPE html> <html xmlns=”http://www.w3.org/1999/xhtml”> <head id=”Head1″ runat=”server”> <title></title> <script type=”text/javascript”> function AccessServerSide() […]

Resolving Background Scrolling Issue Of Modal Popup Vew In Mobile Devices

Posted on November 23rd, 2015 by Ashis Kumar

Problem: While dealing with a scrollable view where a large numbers of data are shown I faced the following issue. When a popup shows above it, the background scrollable view still has focus and can be  scrolled in mobile devices. After much of the research I got the solution and I am sharing it below […]

Embedding Quicktime player in a Dashboard Widget to Listen to an audio file.

Posted on November 23rd, 2015 by Mithlesh Jha

It is fairly easy to embed a QuickTime player in a Dashboard Widget. Dashcode(The IDE for development of a Dashboard Widget) provides us the library of Controls which can be added to the widget. Just drag the Quicktime player from the library onto the widget main front view. The following code is automatically added in […]

Display “Real time clock” in your Filemaker application.

Posted on November 23rd, 2015 by Elishree Dey

To display a real-time clock in your Filemaker application you can use a Web Viewer and add Javascript code to it. You can copy and paste the following code snippet and uncheck all check boxes in the Web Viewer . “data:text/html, <html> <head> <script language=’javascript’ type=’text/javascript’> function displayClock() { var digital = new Date(); var […]

Display A Calendar Showing Current Date Using FileMaker Web Viewer.

Posted on November 23rd, 2015 by Elishree Dey

Display a calendar showing current date using FileMaker web viewer. To display a calendar showing current date in your Filemaker application you can use a web viewer and add javascript code to it. You can copy and paste the following code snippet and uncheck all check boxes in the web viewer, set web viewer size […]

Successive AJAX Call on Key Stroke

Posted on November 23rd, 2015 by Swarup Sahu

In my project, I have a search box. Here I need to made a ajax call on key up so that it will return search results for each text. This is because I do not have any search button to made the ajax call. One more thing, I am using Filemaker database and on each […]

How to use a variable in replace function of JavaScript

Posted on November 23rd, 2015 by Abinash Grahacharya

In JavaScript replace function is basically used to replace some string in an another string. For instance, if  your main string is var main_str =”i am working as a php developer,php is favorite language “; and you want to programmatically replace php to JAVA, you have to write the code as: main_str = main_str.replace(/php/i,’JAVA’); Here,as you can see we calling the replace function with […]

Two minutes to learn Ajax File upload

Posted on November 23rd, 2015 by Dinesh Sahoo

If we have read/seen it somewhere that ” File upload using Ajax”, then it is not through AJAX. File uploading is basically done through an iframe in this case. We have to use an iframe to upload the files. Honestly speaking implementing javascript code using an iframe is quiet difficult for a beginner. In that […]

How To Set Label And Value In jQuery UI Autocomplete

Posted on November 23rd, 2015 by Indrakshi Ghosh

Lets say, we want to show an autocomplete field with different display text and the different raw value using jQuery UI autocomplete. So what will we do. First we have to send our formatted data from the server side coding. Lets take a look to an example: Suppose we want an autocomplete field where we […]

Getting Current Vertical Window Scroll Bar Position In Safari 7.0.1

Posted on November 23rd, 2015 by Elishree Dey

For web applications we are at times required to get the current vertical window scroll bar position. One of the common way to detect it is by using Javascript with out any external plugin function. We can use below javascript function where we can get the window scroll bar position. function getScrollXY() { var x […]

Click Event Issue For Android In Titanium

Posted on November 23rd, 2015 by Lopamudra Joshi

 In Titanium in case of android, if we define “touchstart” and “click” events for a button, the click event will not work untill we defined the “touchend” event for that button. But for iPhone the click event does not depends on “touchend” event. So the code to accomplish the job in both OS the without […]

Simple gradient for IPhone in Titanium.

Posted on November 23rd, 2015 by Lopamudra Joshi

Let say we have a window and we need to give background gradient.   /Define a window var win = Ti.UI.createWindow(); //Apply the background gradient win.backgroundGradient = { type : ‘linear’, colors : [‘color1′,’color2’], startPoint : { x : 0, y : 39 } };Let say we have a window and we need to give […]

Using AJAX Toolkit In Force.com Platform

Posted on November 23rd, 2015 by Smarjit Debata

Force.com platform provides a JavaScript API which provides features to work with sObjects using JavaScript without the help of Apex codes. Is it always necessary to write an apex class for every visualforce page we build ? Not really. Because we have an well built javascript API available in force.com platform I am sure this […]

Refresh parent page on closing modal child window/popup

Posted on November 23rd, 2015 by Saswat Bhuyan

You cannot write a javascript function to refresh parent page from a Modal child pop-up window. Instead, you can put the code to refresh the page just below the line that actually opens the modal popup in the parent page. Since code exceution on parent stops at the point when the modal pop window is […]

How to run Javascript code before document is completely loaded (using jQuery)

Posted on November 23rd, 2015 by Subranil Dalal

JQuery helps faster page load than javascript. JQuery functions are fired when the related elements are loaded, instead of complete pageload. This is a common practice to call a javascript function when page is loaded like window.onload = function(){ alert(“Mindfire”) } or <body onload=”javascript:document.getElementById(‘user_id’).focus();”> Inside of which is the code that we want to run […]

How to include/specify JavaScript code in a HTML document.

Posted on November 23rd, 2015 by Supriti Panda

If you don’t specify any script type and write the following in the HTML document then it works, because the default scripting language for HTML is JavaScript. <script> <!– hide JavaScript code from old browsers YOUR SCRIPT HERE // end the hiding comment –> </script> However mime-type of script is required in HTML specification, and […]

How to Trim a String Using JavaScript

Posted on November 23rd, 2015 by Anurup Gaurav

Context: In programming, trim (or strip) is a common string manipulation function which removes leading and trailing whitespace from a string. Precisely what constituteswhitespace varies between programming languages and implementations, but it normally includes space, tab, line feed, and carriage return characters.The JavaScript language does not currently have a trim function for strings — although […]

Use of JSLint to Verify JavaScript

Posted on November 23rd, 2015 by Anurup Ggaurav

“JSLint is a JavaScript program that looks for problems in JavaScript programs.” It takes a JavaScript source, scans, syntax-checks, and validates it. If it finds a problem in your code, it returns a message describing the problem and an approximate location within the source.JSLint is a code quality tool. Not only does it find syntax […]

Javascript function to dynamically enable/disable controls

Posted on November 23rd, 2015 by Santono Patra

y using the following  javascript function you can dynamically set the status of all controls of a form to readonly or disable depending upon which attribute (readonly or disable) the particular control supports. Further, you can also enable/disable controls according to their type by slightly modifying the code. ( toggle boolean property of the control )   Call the  […]

How to enable a disabled asp.net check box using Javascript

Posted on November 23rd, 2015 by Santono Patra

In one of my earlier tips I have shown how to disable all controls of a ASP.Net form using a Javascript function but enabling those controls is not as straight-forward task. When we disable a checkbox, its parent node is disabled too. So while re-enabling it we need to enable the parent node first. If […]

Basic JQuery syntax

Posted on November 23rd, 2015 by Subranil Dalal

Basic jQuery syntax and simplified AJAX How to use DOM equivalent code withe JQuery. How to get HTML fields value. Text field: $(‘#name’).val(); Drop Down: $(‘#category option:selected’).val(); Radio Or Check Box: $(‘#checkid’).attr(‘checked’); // return true if checked other wise false; HTML content : $(‘#div’).html(); // same as innerHTML of DOM How to set value of […]

Disabling right click in browser using JavaScript

Posted on November 23rd, 2015 by Santono Patra

Some times we need to disable the right click option in the web browser for security reason .The following code  can be used to implement this functionality in the best way. <script language =”javascript” > function DisableRightClick() { if (event.button == 2) { alert(“Right Click is not possible Here !”) } } document.onmousedown=DisableRightClick; </script >

To display text words from a list of words in comma separated form in small div with Javascript

Posted on November 23rd, 2015 by Abinash Grahacharya

Description While designing websites we often come across situations where we have to display data in limited space  programmatically and we have to split data into chunks to accommodate them. However, if we are dealing with meaningful text then the splitting occurs without taking into account grammatical structures and words structures, so we end up […]

Javascript array sorting based on position of specified character in the string

Posted on November 23rd, 2015 by Abinash Grahacharya

Recently, I was looking fro a Javascript function or a tutorial on how to sort an array based on the position of a character in an input string. For instance, if I have 20 names in an array and I type “s” in the text box the result should give me all the names that […]

Attaching event handler dynamically to a control in javascript

Posted on November 23rd, 2015 by Satyaprakash Sahu

There are several ways to attach an event handler to a control dynamically using javascript. document.getElementById(“btn”).attachEvent(“onclick”, NewFuntion);  document.getElementById(“btn”).onclick = NewFuntion; Lets say a button object in your HTML code already has a function assigned in its onclick event onclick=”function1();” and you want to add another function (say NewFuntion() ) to the onclick attribute of the button, you can do so in more than one ways. function […]

Opening new PopUp window in FullScreen Mode and channelmode

Posted on November 23rd, 2015 by Santono Patra

Sometimes we need to show our secondary window  to cover the whole screen. Many of us  are not aware of two new features available in IE  .These new features control the newly opened window in an entirely new way. Opening PopUp Window in FullScreen Mode : Using window.open() method, we can set the width/height,location ,toolbars etc programatically . […]

Using AJAX with jQuery

Posted on November 23rd, 2015 by Subranil Dalal

Ajax is most easy thing with jQuery. jQuery has a number of beautiful functions to make easy stuff more easier and compelx stuff as simple as possible. .load() This function load a chunck of code dynamically into a page. $(“#button”).click(function(){ $(“#div”).load(“test.php”); }); $.post() &&  $.get() $.get(url, [data], [callback], [type]) or $.post(url, [data], [callback], [type]) url: (String) The URL […]

Few Tips on Javascript

Posted on November 23rd, 2015 by Abhay Raut

A few tips for copying text to clipboard and how to use buttons like forward and backward like  in browser and changes color of scrollbar. 1. If you want a  page to have a forward and backward button to navigate forward and backward (similar to basic functionality of a web browser) you can use the following code. <input type=”button” […]

Minify js code using jQuery

Posted on November 23rd, 2015 by Subranil Dala

How to attach same function with multiple HTML elements by a single line js code using jQuery Recently I was working on a online shopping cart and auctioning site which required a lot of Javascript code. Each page in the site had a number of “Buy” or “Bid” links associated with different HTML Ids. For instance, if […]

How to dynamically add rows very quickly using jQuery

Posted on November 23rd, 2015 by Subranil Dalal

n many projects we give options to users to add multiple rows for submitting multiple records. To do this we simply provide an add button, after clicking on which the user can add or clone another row using javascript. Through normal javascript we use insertCell(var) and appendChild(DOM) for creating cell and adding that cell to a parent element. Various properties of the cell including  […]

Different types of client side validation for Web 2.0 in Javascript and CSS

Posted on November 23rd, 2015 by Abinash Grahacharya

With Web 2.0 ,  websites are becoming more attractive as well as more interactive, so to keep up with the pace we have to make our validation process more interactive too with the help of Javascript and CSS. This code snippet demonstrates 6 different types of visual response to Javascript-based validation of a form. Different […]

How to Pass URL dynamically in Web-driver using Java

Posted on November 23rd, 2015 by Pritam Pradhan

A customer relationship management system like Microsoft’s Dynamic CRM (MSD-CRM) can be customized but has generic features. So, every user has access to generic features but for each user/customer there are different URLs. So, suppose you have to automate the CRM for multiple user having the same features but different URL and for that you […]

Change background color of your web-page automatically

Posted on November 23rd, 2015 by Soumya Panda

The following Javascript code will help you change the background-color of your web-page automatically and at a time-interval (in milli-seconds) as specified in the code. <head> <script type=”text/javascript” language=”javascript”> /* Method To Generate Random Numbers Between “0-255” for RGB Color-code Format & Assign To Body-Backgrond-Style */ function bgDisco() { var x =Math.round(255*Math.random()); var num1 =getHex(x); var y =Math.round(255*Math.random()); var […]

How to fire js function by a specific key press by jQuery

Posted on November 23rd, 2015 by Subranil Dalal

A form with a submit button is perhaps the most regular feature in web applications, when the user clicks on the submit button or presses the “Enter” key, the form is submitted. <input id=”search_text” class=”search” type=”text” name= “search_text” /> <input type=”button” value=”Search” onclick=”search();” /> Here is a text field and button which call a search […]

Creating a custom “Share on Facebook” button

Posted on November 23rd, 2015 by Danish Ahmed

At the present date you are unlikely to come across any content page that does not provide option to save the URL in Social Bookmarking sites or Social Networking sites. As a developer adding these functionalities is easy as there are a number of free widgets available that can be added without a lot of fuss. Further, […]

Consuming WebService and WCF from jQuery.

Posted on November 23rd, 2015 by Jnana Swain

If Asp.net Ajax framework is used, web service and WCF service methods are consumed by ScriptManager. For jQuery framework, these services are consumed by following ways. Example: Create  Ajax-EnabledWCFService, name it “TimeService.svc”. Put Following code in the TimeService class. [OperationContract] public string GetTime() { return “<B>” + “Current Server Time : ” + DateTime.Now.ToLocalTime() + “</B>” ; } ASPX Page <script […]

How to set alternative row color of grid using jQuery

Posted on November 23rd, 2015 by Subranil Dalal

When we represent some data in a grid view we usually prefer to set alternative row color. For this we can use two css classes with different background colors or inline styles. What we need to do is that while constructing the grid by looping through data set, we can check the loop count is odd or even and […]

How to display Javascript Yes/No confirm dialog instead of Ok/Cancel ?

Posted on November 23rd, 2015 by Sabitree Sahu

How to display Javascript Yes/No confirm dialog instead of Ok/Cancel in Internet Explorer In few cases we need to show Yes/No popup instead of Ok/Cancel confirm dialog box. You can do it by the following code. Write the following code in your HTML Page. <script language=”javascript” type=”text/javascript”> function window.confirm(str) { execScript(‘n = msgbox(“‘+str+'”,”4132″)’, “vbscript”); return(n […]

Implementing Google Maps using jQuery

Posted on November 23rd, 2015 by Subranil Dalal

Implementing Google maps with with jQuery is quite easy once you know it. In this tip I am going to demonstrate how you it can be done. For implementing Google maps, the first thing you need is the Google maps api key for your website.A single Maps API key is valid for a single “directory” […]

JavaScript – ParseInt – Something all web developers should know

Posted on November 23rd, 2015 by Kaushik Mohanty

How often do you use parseInt in your javascript applications? Have you noticed some strange behavior of the same? If you notice carefully you can find parseInt(“08”) and parseInt(“09”) return value 0 instead of 8 and 9. This might lead to serious problems if you continue to ignore it. FACTORS BEHIND THIS In Javascript, the […]

How to delete cookies programmatically using Javascript

Posted on November 23rd, 2015 by Prakash Pothal

Sometimes we need to  handle the Cookies  in javascript. The following Javascript  code can be used to delete the cookies. function loaded() { document.cookie = “v0=1;”; document.cookie = “v1=2;”; alert(document.cookie); } function deletecook() { var d = new Date(); document.cookie = “v0=1;expires=” + d.toGMTString() + “;” + “;”; alert(document.cookie); } Call this method on the “onload ” […]

Get Return value from ModalPopup in parent page

Posted on November 23rd, 2015 by Biswajit Satapathy

This Javascript code snippet shows you how to open a modal popup window for user input and return the value to the parent page. function OpenModalPopup() { var url = “DemoModalPopup.aspx”; var parameter = ” dialogWidth=” + Math.floor(screen.availWidth/2) + “px; ” + ” dialogHeight=” + Math.floor(screen.availHeight/2) + “px; ” + ” center=yes; help=yes; ” + ” status=no; […]

Adding rows in table dynamically

Posted on November 23rd, 2015 by Pratush Srivastava

The following Javascript function demonstrates how to add multiple rows to a web page during runtime using addRow() function <HTML> <script> function addRow(){ var table=document.getElementById(‘countTable’); var tbody=document.getElementsByTagName(‘TBODY’)[0]; var row=document.createElement(‘TR’); var cell1=document.createElement(‘TD’); var cell2=document.createElement(‘TD’); var cell3=document.createElement(‘TD’); var cell1value=”; cell1value+=’One <input type=”text” name=”one” value=””>’; var cell2value=”; cell2value+=’Two <input type=”text” name=”two” value=””>’; var cell3value=”; cell3value+=’Three <input type=”text” name=”three” value=””>’; cell1.innerHTML=cell1value; […]

Removing White Space character using Regular Expression

Posted on November 23rd, 2015 by Rashmita Mohanty

During development I have often face an issue, when I try to pass a URL path from the Server side to the Client side using the following line of code: var testUrl = “<%= url %>”; Its returns me the correct path value but the URL path is append with white space character at the end of […]

Js function to convert accented characters to corresponding English alphabets

Posted on November 23rd, 2015 by Mohanish Das

My last project required me to deal with accented characters. We needed to change these accented characters to normal english characters because the accented characters gets encoded while being passed through an URL. The following code snippet shows how to change accented characters to their corresponding English alphabets. <script> function js_accent_translate(text) { var str = […]

Zooming a web page using Javascript functions

Posted on November 23rd, 2015 by Soumya Patnaik

Set the Zoom percent to 100% in the page. <body runat=”server” id=”Body” style=”zoom: 100%”> </body> Use this Javascript function to set the zoom in and zoom out to 10%  for the page function zoomIn() { var Page = document.getElementById(‘Body’); var zoom = parseInt(Page.style.zoom) + 10 +’%’ Page.style.zoom = zoom; return false; } function zoomOut() { […]

Cross browser compatible method to prevent users from using browser BACK button

Posted on November 23rd, 2015 by Stiti Samantaray

There are many programming techniques to implement functionality preventing users from navigating to the previous page by clicking the back button of the browser. But one of the simplest techniques involves a Javascript function that checks in a given time interval and takes the user forward. Calling the function on onLoad event of the page […]

Reset or clear the form data when form is submitted by AJAX using jQuery

Posted on November 23rd, 2015 by Subranil Dalal

When a form is submitted through submit button click the form data is subsequently cleared or reset . But when we submit a form by AJAX then we have to clear the form data by picking every element and setting the value as blank. If a form contains more than 100 input fields then it […]

How to position a div at center of the browser in any resolution of screen

Posted on November 23rd, 2015 by Mritunjay Kumar

Some time we need to set a div at the center of the browser irrespective of different resolutions of output screen. Height attribute set as 100% won’t work. If we set height in pixels then too it may not show properly at the center on screen with different resolutions. So, here is a solution I […]

Displaying countdown time on webpage

Posted on November 23rd, 2015 by Asish Tripathy

Some times we need to diaplay countdown time on the webpage. Here is a small javascript code to display countdown time on the webpage. <html> <head> <title> Countdown time</title> </head> <body> <div>[clock2]</div> </body> <script> countdown_start(“timer”,”07/29/2009 2:00 PM”) function countdown_start(divid,givendate) { var given_date = new Date(givendate); var cur_date = new Date(); diff = new Date(given_date – […]

Sliding div panel using jQuery

Posted on November 23rd, 2015 by Sulagna Mohanty

he following piece of code illustrates the extended div panel. Click on the link, the div will expand and display information. But before proceeding do note that for the following code snippet to work, you must download jquery-1.3.2.js from here (hhttp://docs.jquery.com/Release:jQuery_1.3.2)  Steps to follow: 1.Include the following script inside the head section. <script type=’text/javascript’ src=’jquery-1.3.2.js’></script> <script […]

Select/ DeSelect all checkboxes in gridview using JQuery

Posted on November 23rd, 2015 by Sabitree Sahu

Selecting all checkboxes by selecting the checkbox in the header of the gridview is a common operation in ASP.NET applications. We could do the same thing but writing less code and giving less effort by using JQuery. The following code is used to perform the SelectAll / DeSelectAll function. <script type=”text/javascript” src=”http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js”></script> <script type=”text/javascript”> function […]

Expandable and Collapsible / Accordion type content using jQuery

Posted on November 23rd, 2015 by Subranil Dalal

These days while creating web applications we are increasingly finding ourselves in situations where we have to show data selectively. For instance using tab/ accordion/ show-hide div to display data is one such situation. This tip is an example of expand and collapse features which can be implemented to interactively show data to user. This […]

Create customized context menu for an object using JavaScript and CSS

Posted on November 23rd, 2015 by Stiti Samantaray

One can disable the right click on an object by just specifyingoncontextmenu= “return false;” on the HTML object. If you want to disable the right click option on the whole web page, then use has to call above event on the html <body> tag e.g. <body oncontextmenu= “return false;”>.   You can perform certain task on right […]

Detecting User’s Browser Using Javascript

Posted on November 23rd, 2015 by Rasmita Mohanty

In a Web application the output always depends on the browser of the user’s machine. So sometime due to some invalid browser or due to some settings in browser we do not get the desired output in client machine. By using the following set of JavaScript code we can detect any invalid browser and for […]

Detect cookie using JavaScript protocol

Posted on November 23rd, 2015 by Abinash Grahacharya

f you want to find out the cookie asssociated with the page you are currently in, you can do so without leaving the page or even minimizing your browser window. All you have to do is use JavaScript protocol and call the alertfunction with document.cookie as parameter. For example if you are on http://www.mindfiresolutions.com/” target=”_blank”>http://www.mindfiresolutions.com, all […]

Numeric validation using Javascript

Posted on November 23rd, 2015 by Biswajit Satapathy

Basicallly When we trying to validate a form some time we need numeric validation for textbox. We can validate textbox by onkeypress event of the control By checking whether the keycode of the key pressed as the user types falls within the range of the number keys 48-57(i.e 0-9 and ‘.’) ,if not belong to […]

Using Javascript Protocol To View Source

Posted on November 23rd, 2015 by Devi Das

After a webpage is loaded in the browser, if we do ViewSource it displays the state of the page. But sometimes it is very necessary to see the current state of the page, when we are working with a page which contains dynamic content. There is a javascript approach (Javascript) by which we can see the state of the page by […]

A slider control with Javascript and CSS to Resize Image

Posted on November 23rd, 2015 by Abinash Grahacharya

Recently I have implemented image resizing feature in a project bit differently. What I have done is, implemented a new slider control which can be used to control the size of the image. You can increase or decrease the size of the image by dragging the marker in the slider control, very much like you […]

How to create a customized confirmation alert in javascript

Posted on November 23rd, 2015 by Chandana Das

When you implement a delete feature in your application, a very basic additional feature which is always expected to be implemented is a confirmation box, so that the user gets a prompt before doing some delete activity. For implementing this, there is already a Javascript function called confirm(). The syntax for this is very simple […]

Java script validation for fckeditor( Mandatory field check)

Posted on November 23rd, 2015 by Manish Tiwari

If you are using fckeditor on your web page and you want it as a mandatory field. Use following javascript code to validate: function Validate() { varError = “”; var objFCKeditor1 = document.getElementById(‘<%=FCKeditor1.ClientID%>’); if(FCKeditorAPI.GetInstance(objFCKeditor1.id).GetXHTML(true) ==””) { varError += “Entering text in fckeditor is mandatory.\n”; } if(varError !=”) { alert(varError); return false; } } here FCKeditor1 […]

JavaScript validation to check input file type(extension).

Posted on November 23rd, 2015 by Manish Tewari

Sometimes we use input file type to upload our document/file etc. We need to check that the file type(extension) is something like we needed, or to specify the file type to a particular file type(extension) use following javascript function to validate file type(extension) : //function to validate file extension function validateFileExtension(fld,FieldName) { if(!/(\.txt|\.pdf|\.exls|\.doc)$/i.test(fld)) { varError […]

Make your website faster: Adding Javascript and CSS files at run time

Posted on November 23rd, 2015 by Abinash Grahacharya

If you want to load your website faster and have good ranking for your website in y-slow of similar tools please go through this tip. I have discovered a technique for adding javascript and CSS files at run time, it has been checked in various ways and I am also giving the sample code to […]

Using 2-digit year in MaxEditExtender from AjaxToolKit

Posted on November 23rd, 2015 by Monalisa Brahma

I was using MaskedEditExtender from AjaxToolKit in My application .It takes Mask=”99/99/9999″ as default one which display 4 digit year. But i want 2-digit year in my application i.e 08 and not 2008. So I changed the Mask to “99/99/99” but it was throwing a JavaScript exception as displayed below So To fix this issue, […]

How to select all fields or only input fields of a form by jQuery

Posted on November 23rd, 2015 by Subranil Dalal

At times we are in situations where we have to programmatically select all fields or only input fields of a form. We can select every field one by one by using element id, class, tag name or other jQuery selectors, but it is a lengthy process. Suppose we have to disable a form’s elements. STEP […]

jQuery : Protect form submission on enter key-press

Posted on November 23rd, 2015 by Subranil Dalal

HTML form has a property that if we press enter key when cursor is focused inside any input field then form will be submitted. So if you filling up a form and you are in between and by mistake you press enter key your data will be submitted which is not completed. HTML forms are […]

Some important JavaScript functions and their use.

Posted on November 23rd, 2015 by Devi Das

var objStack = [] objStack.push(2); objStack.push(5); objStack.push(8); So here objStack will behave as a Stack object & it will follow FIFO (First-In First-Out) concept. We can access the value of the object by – objStack[1]; // It will give the 2nd element’s value, i.e 5. objStack.toString(); // It will give the values separated by comma, […]

Add a Back-To-Top button to your extra long web pages

Posted on November 23rd, 2015 by Anita Bhanja

You may have seen ‘back to top’ link to take the user to top of the page. There are two ways to do it. 1. Giving the position to (0,0) through javascript. <a href=”javascript:scroll(0,0)”> Back to top </a> You can specify any position by x- and y- coordinate to scroll to particular position in the […]

Animated scrolling using jQuery

Posted on November 23rd, 2015 by Sachin Kumar

For scrolling to the top of the document , we can write a javascript like : window.scrollTo(0,0); But its transition effect is left visible . If we want a smooth animation to show the scrolling , we can use the following jQuery code : $(‘html,body’).animate({ ScrollTop: 0 }, 1000); In order to scroll “hml/body” you […]

How to get language specific Skype status in text format

Posted on November 23rd, 2015 by Subranil Dalal

In my previous tip ‘How to get Skype status on the web application and make call or chat from web application’ I showed how to get skype status by getting a skype icon. But at times we need to get the skype status in text. Here I am giving an example of how to get […]

Solution: Access to restricted URI denied” code: “1012

Posted on November 23rd, 2015 by Bimal Biswal

At times I have come across “Access to restricted URI denied” code: “1012 even when making a legitimate AJAX call but from a different directory/site level. I know this is a security feature to restrict cross domain AJAX call. But firefox throws this error when calling a file in the same domain also (but not […]

Checking Network Connectivity Status using HTML5 and JavaScript.

Posted on November 23rd, 2015 by Sourabha Sahoo

It would be nice if you can check for connectivity status( online/offline ) of the user. So you can check if the user is online/offline by  polling the  navigator.onLine property. Example: (function () { setInterval(function () { var NetworkStatus = document.getElementById(“status”), isOnline = navigator.onLine; if (isOnline) { NetworkStatus.innerHTML = “Online”; NetworkStatus.className = “online”; } else […]

Tip to work around if DropDown event is unable to submit form

Posted on November 23rd, 2015 by Shweta Chottray

Onchange of dropdown value when we try to sumit the form , it does not work. The reason is that it might be having a submit button with the same name as the function in the same form. Recently when I tried to submit a form on the OnChange event of a DropDown Control, it […]

Design jQuery Stuff with GUI in Minutes

Posted on November 23rd, 2015 by Sathyan R

An exciting, awesome tool to gnerate the required jQuery, CSS and HTML for some stunning looking stuff. Now everyone can create Great looking jQuery pages/controls within minutes. http://visitmix.com/labs/glimmer/ Install the setup (license is Free as long as its done on a valid, licensed Windows machine) and launch the App and create jQuery files like a […]

Showing a list of texts and values of all check boxes on a page (Using Jquery)

Posted on November 23rd, 2015 by Smruti Sahoo

JQUERY allows us to find and manipulate HTML elements with very little coding. This tip is only a small example of that. The code below demonstrates how to retrieve all values of check boxes. Please remember to include reference to JQUERY before proceeding further. function ShowAllValues() { var values = “”; $(‘input[type=checkbox]’).each(function() { var value […]

Make a control non-printable using CSS

Posted on November 23rd, 2015 by Santosh Bisoyi

Most of the time you may come accross a simple implementation like printing a web page. But here I will not discuss about how to print a web page, instead I will discuss on how to not print specific elements on the page with the help of a CSS hack. For example we have a […]

Create your own RTE using DIV and jQuery

Posted on November 23rd, 2015 by Subranil Dalal

I think most of us working on web technology are well aware of the Rich Text Editor. Generally, when our functionalities require us to embed a Rich Text Editor in page we fall back to FCKEditor or Tinymce. But these editors may not exactly be light weight for our minimal requirements. Of course, we can […]

How to know Textbox’s value has changed or not?

Posted on November 23rd, 2015 by Devi Das

Problem There is a textbox in your webpage and you want to submit form only if the textbox’s value has changed else you want tol show some validation message. Solution But how to do it? One approach would be to take a hidden field along with the textbox which keeps the textbox’s default value and […]

Using jQuery scrollTop() function

Posted on November 23rd, 2015 by Devi Das

jQuery function scrollTop() gives the distance between the top of the object and the topmost portion of the content of the object currently visible and can be used to determine the amount you have scrolled. e.g: $(window).scrollTop() will give you the amount you have scrolled from the topmost part of the page. This can be […]

How to check CAPS lock status in Javascript ?

Posted on November 23rd, 2015 by Aditya Acharya

Sometimes, it happens that after entering the same lucky password, the sign in mechanism doesn’t allow you to enter into the system. You are tired of trying all your passwords but lo, your caps lock is on and you have not noticed it yet. The question is why didn’t the web page indicate it ? […]

Make jQuery datepicker to popup in different positions

Posted on November 23rd, 2015 by Sachin Kumar

Datepicker is a rich widget of jQuery library . It exposes a lot of properties and methods to make it customizable . Once, while working with it , we needed to popup the datepicker just at side of the textbox . But the default popup position is just below the text box so we had […]

How to get the Integer part of an ID of a clicked button in jQuery

Posted on November 23rd, 2015 by Ashabari Jena

In jQuery, when we want to get the integer part of an “id” on click of a button element , we generally do it by using the substring() method, by taking the initial point from where the integer may start. But we can also do this using a different approach In this example we have […]

How to Restrict Entering of Future Date in Textbox using jQuery

Posted on November 23rd, 2015 by Monalisa Pradhan

We can use Mask plugin of jQuery for Datefield as $(txtBox).setMask(“19/39/9999”) which will accept inputs in mm/dd/yyyy format. While using this we may face problems if it accepts invalid values like : Month value > 12, date value > 31 and also future dates. The solution to this is after giving the date value in […]

Dynamically Place DropDown inside a LI using jQuery

Posted on November 23rd, 2015 by Surama Hotta

Sometimes we have a requirement to change the controls(from label to textbox/label to dropdown) dynamically (based upon user input/event like click of Edit button). In that case what we generally do is create multiple set of controls, and based on the requirement we show & hide these controls. But that creates lot of performance and […]

Programmatically change jQuery accordion

Posted on November 23rd, 2015 by Sachin Kumar

jQuery provides us a rich set of UI controls to be used in our sites like (Datepicker, Tabs, Accordion etc.). Accordion allow us to accommodate more than one panels in one control . Each panel may have different data to display, but at a time we can show only one panel . At one time […]

Printing content of a particular div

Posted on November 23rd, 2015 by Sachin Kumar

Problem: While working in a web page, we were required to print only one section (say a div content) of a page. There is a single line Javascript code to do printing. “window.print();” However, this function would print the whole page content, which is not what we want. Solution: To meet the above objective we […]

Using PageRequestManager class to disable controls during an unfinished AJAX call

Posted on November 23rd, 2015 by Author: Sumit Singh

Some times there is a need to stop multiple asynchronous(AJAX) requests from a single page. If you are using ASP.net Ajax Extensions as your Ajax Framework, then Sys.WebForms.PageRequestManager is the class, that can help you to catch the InitializeRequest and EndRequest events. Now you can add JavaScript functions to these events for disabling controls, showing progress dialogs etc Here […]

How to clear a fileupload control in IE and Mozilla using Javascript

Posted on November 23rd, 2015 by Ashabari Jena

When we want to clear a fileupload control on onchange event using javascript , either it is working in IE or in mozilla. Here is a simple solution for both IE or Mozilla : When we try to clear fileupload control on OnChange event using Javascript, we often find that the code we have added […]

(jQuery) FromDate to ToDate Validation

Posted on November 23rd, 2015 by Subhranil Dalal

At times, when validating forms we have to validate two date fields, From Date (Start Date) and To Date (End Date) when date pickers are associated with respective fields. Using normal Javascript it is big task to write a validating function. Normally the logic we use to validate From Date and End Date is like. […]

Find the querystring value through Javascript.

Posted on November 23rd, 2015 by Aditya Acharya

Query string values are easy implementation of managing states. This value is transferred to the server with the URL string. In server side if you want to access these values it is quite easy. But there may be some situation where you may be required to access the querystring values through Javascript. It can be […]

Changing font size of particular elements using Javascript

Posted on November 23rd, 2015 by Narendra Mallik

Many websites are now allowing users to change font-size of a page or a part of it to increase the usability factor. We can implement this feature in a page of our website in the following manner. 1.Find the elements whose font size you want to be changed as a part of this usability change. […]

Filtering AutoCompleteExtender Service Calls

Posted on November 23rd, 2015 by Sumit Singh

  In AutoCompleteExtender in almost every key press in the textbox, the Ajax call goes to the associated web service. Few service calls are stopped by caching if it is enabled. But in most cases it fires. So, if you enter 20 character, then 20 times call goes to the service and subsequently, 20 times […]

How to merge your Javascript files in ASP.NET

Posted on November 23rd, 2015 by Devi Das

When a user is loading a web page, for every object on the page (e.g: images, stylesheets, scripts) there is a corresponding HTTP request made to the server. These HTTP requests will delay the response time if the web page contains large number of objects. To reduce the delay, we have to get rid of […]

Bind jQuery Grid without service call

Posted on November 23rd, 2015 by TUSHAR MISHRA

Query Grid plugin is an Ajax Enabled Javascript control that represents tabular data on web page. It loads data on client side, dynamically through Ajax callbacks. To bind the grid using jqGrid plugin you have to provide raw data in the format of XML data, JSON, or in array format. And for binding the grid […]

jQuery and Asynchronous Postback with UpdatePanel Issue

Posted on November 23rd, 2015 by Aditya Acharya

What  If you are using jQuery in your application then you may be familiar withdocument.ready() function of jQuery. This function executes after all the elements are loaded in the page. So it is a better way to bind the events for elements or to write some initialization Javascript which we want to be called on […]

An easy way to bind ‘DELETE confirmation message’ to .NET controls

Posted on November 23rd, 2015 by Santosh Bisoyi

You always come accross a confirmation message “Are you sure you want to delete this item ? ” while deleting an item. In web application basically  we attach a javascript function with the OnClientClick event of the server control to ask user confirmation before delete the item. So this is not a big problem if […]

Creating drag and drop for grid in Extjs.

Posted on November 23rd, 2015 by Pratibind Jha

This tip shows how to create a panel that shows how rows can be easily dragged and dropped between two or more grids in Extjs-4.2 Note:- This drag and drop is helpfull when we have list of user out of these to select some of them ,or give some previlage,authentication,add as a friend etc we […]

Access instance of a Radiobutton from Radiobuttonlist through Javascript

Posted on November 23rd, 2015 by Aditya Acharya

If we are using ASP.NET Radiobuttonlist in our page it becomes a little difficult to find the instance of it through Javascript  because it is rendered in a different way in the browser ( the code is reproduced below ) ASP.net Code —————– <asp:RadioButtonList ID=”RadioButtonList1″ runat=”server” RepeatLayout=”Table”> <asp:ListItem Text=”AAA”></asp:ListItem> <asp:ListItem Text=”BBB”></asp:ListItem> </asp:RadioButtonList> Is rendered in […]

Secret of ASP.NET Validation control

Posted on November 23rd, 2015 by Devi Das

In your projects you must have used ASP.NET validation controls like Required Field Validator, Range Validator, Custom validator, etc. Suppose in a page you have used Required Field Validator for a textbox, so while Form submission it will validate the textbox control for its value. But if you want to disable validation for a particular […]

Add tooltip to ASP.NET Datapager

Posted on November 23rd, 2015 by Aditya Acharya

ASP.NET pager doesn’t provide any direct support for adding tooltip to its different buttons . But there are some work arounds through which you can provide tooltips to ASP.NET data pager. The structure of a simple data pager is as follows: <asp:DataPager ID=”dpPager” runat=”server” PagedControlID=”lvCourses” PageSize=”5″ OnPreRender=”dpPager_PreRender”> <Fields> <asp:NextPreviousPagerField ButtonCssClass=”command ” FirstPageText=”«” PreviousPageText=”‹” RenderDisabledButtonsAsLabels=”true” ShowFirstPageButton=”true” […]

Use of noscript tag

Posted on November 23rd, 2015 by Rabinarayan Biswal

If Javascript is disbaled in your browser, you can display a warning message to the user by adding “noscript” tag inside the body element. <body> <noscript> <h1> Javascript is disabled in your Browser . Please enable it. </h1> </noscript> …… </body> This noscript tag is supported by all major browsers like IE, Firefox, Opera, GoogleChrome […]

Opening a popup window at center of the screen

Posted on November 23rd, 2015 by Anita Bhanja

Opening a popup window at center of the screen : Level : Beginner You can open popup window through javascript. But opening it at center of the screen will make it look good for all size of screen. Following is the way to do it : This is the link to open popup window <a […]

Dark side of AJAX Control toolkit’s Rating Control in ASP.NET

Posted on November 23rd, 2015 by Devi Das

AJAX Control toolkit provides sophisticated RATING control using which you can have rating facility in your website. Its very simple to use but there is a problem you could come across while creating it dynamically. The problem is in the ViewState, which means you can’t get the selected rating value of dynamic Rating control (from […]

Paging in JQGrid using WCF service

Posted on November 23rd, 2015 by Satyadeep Kumar

Recently I was working with jQGrid when I came across a major block, the solution of which I now wish to share through this tip. In case you don’t know, jQGrid is a free jQuery component which has a lot of features and can be used to display data in tabular format like you do […]

An efficient way to refresh the parent page from child popup window

Posted on November 23rd, 2015 by Sachin Kumar

Problem : Let us think of a scenario : Suppose we have a search page (A.aspx) which contains a tabular view of student data . The page contains a filter button to filter the students based on some condition . Initially the table contains all students data (say 100 records) . Now after pressing the […]

Manage ASP.NET Client side validation using Javascript

Posted on November 23rd, 2015 by Aditya Acharya

Content: As we all know ASP.NET provide some validation extenders which can be implemented on controls to validate them at Client & Server side. Some of those validations extenders are : . Required Field Validator (Validate the control for not filling up any information). . Range Validator (Validate the cotrol with respect to lower & […]

A secure way of sending information to a web service.

Posted on November 23rd, 2015 by Aditya Acharya

Using AJAX and web services in your application can make it richer. But passing information from the client end through Ajax is always a headache as the information can be hacked. That means the end user can change the post parameter values and can explore information that you want to hide from them (Only if […]

Tip for Developers working on Third Party Controls

Posted on November 23rd, 2015 by Palash Mondal

PROBLEM Due to clients requirements, most of the time I had to work on Third Party Controls like Infragistics. But the problem I faced while working with these controls is that the source code / samples for these controls is minimal or not correct or we have to search multiple forums before getting the solution. […]

Creating Downloadable PDF in ASP.NET With Client Side Event Call

Posted on November 23rd, 2015 by Priyojit Mondal

Scenario : There will be a button, when user clicks it, a dialog box will open that provides user with two options, either user can directly view or save the pdf file in his/her local machine. The pdf will contain all the details of a perticuler user whose first and last name will be given […]

Please Wait Message/ Image While Loading A Crystal Report

Posted on November 23rd, 2015 by Ashish Kumar

While working with CrystalReport we usually meet situations in which the report will take more then usual time in loading.Here i am talking about crystal report but it may be the situation of any heavy page. In these situation due to lack of information user may try to click or may be close the browser […]

URL encoding and decoding in ExtJS

Posted on November 23rd, 2015 by ABHAS PATNAIK

Encoding URLs in ExtJS :- We can encode urls in ExtJS using the Ext.urlEncode() function. Example: Let’s take a sample object : var selectedTopics = {topic1:’Struts’, topic2:’Spring’, topic3:’Hibernate’}; Now let’s Convert the object to URL data: var encodedUrl = Ext.urlEncode(selectedTopics ); The encodedUrl is an encoded URL query string like topic1=Struts&topic2=Spring&topic3=Hibernate Decoding URLs in ExtJS […]

How to color column elements of a GridPanel in ExtJS

Posted on November 23rd, 2015 by ABHAS PATNAIK

This is a brief demonstration on coloring the column elements of a GridPanel in ExtJS. Now if we want to identify the jobs having the status ‘FINISHED_FAILURE’ by coloring the status messages with red. We may proceed as follows. var jobGrid = new Ext.grid.GridPanel({ store: jobStore, frame: false, trackMouseOver: false, disableSelection: true, loadMask: true, //*************** […]

Maintain div scroll position on postback

Posted on November 23rd, 2015 by Palash Mondal

Sometimes we need to maintain the DIV scroll position on postback. Here is how we can do it using JavaScript and Cookies. ASPX   <style type=”text/css”> #divSample{width:150px;height:200px;overflow:auto} </style> <script type=”text/javascript”> window.onload = MaintainDivScrollPosition; // Functions to save, read and erase cookies function createCookie(name,value,days) { if (days) { var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var expires […]

Hide menu items from Web Scheduler Context Menu

Posted on November 23rd, 2015 by Palash Mondal

Sometimes we need to hide some menu items from context menu in InterSoft WebScheduler. Here is a simple way to do that using JavaScript. Just add this JavaScript function below in the WebScheduler client side event. ASPX <ISWebScheduler:WebScheduler ID=”WebScheduler1″ runat=”server”> <ClientSideEvents OnContextMenu=”WebScheduler_OnContextMenu” /> </ISWebScheduler:WebScheduler> function WebScheduler_OnContextMenu(controlId, type, menuObj, el, eventView) { menuObj.Items[4].Hide(); //** Hide All […]

Saving Form With Enter Button In Extjs.

Posted on November 23rd, 2015 by Saroj Panigrahy

To focus a Form field(Textfield/combo box) with the form load, just to add a “keyup/keypress etc. events” to the listener of the corresponding listener of that field. Example:– Let the Login form have two Textfields 1. UserNameField and 2. passwordField Now you are trying to focus the first Textfield on the form load and execute […]

Showing Web Notification in Chrome browser using HTML5 and JavaScript.

Posted on November 23rd, 2015 by Sourabha Sahoo

You can show notification in your webpage simply using HTML5 and javascript. First you need to check browser compatibility for notification feature like this if (window.webkitNotifications) { alert(‘your browser supports notification.’); } else { alert(‘your browser does not support notification.’); } Then you can show the notification by using the following code function notification () […]

Select Multiple Radio Button in Aspx Radiobuttonlist

Posted on November 23rd, 2015 by Sibasis Jena

We can select multiple radio button using jquery. Inside document ready function remove the name attribute from each radio button inside the list $(document).ready(function () { $(“#rblIntrestedTechnology input”).each(function () { $(this).removeAttr(“name”); }); }); Put your radiobuttonlist id in place of “rblIntrestedTechnology”

Set/Change Empty Message for RAD Text Box

Posted on November 23rd, 2015 by Ankit Arora

Several Time We have a requirement to have some descriptive text in the Text box when there is no text in that text box. and as soon as we focus that text box that message goes away and allow user to enter the text. For this functionality Telerik’s Rad Text Box has a Property Empty […]

Retrieving lat/long IP address

Posted on November 23rd, 2015 by Vikram Mishra

Retrieve the user’s current geolocation(lat/long) using current IP address of the user. Retrieving User’s lat/long from their IP address using javascript:- 1.Using google clientlocation loader AP <script type=”text/javascript” src=”http://www.google.com/jsapi?key=your_key_here”></script> <script type=”text/javascript”> if(google.loader.ClientLocation) { lat = google.loader.ClientLocation.latitude; lon = google.loader.ClientLocation.longitude; } else { //do error handling } </script> Note:- Here key is not mandatory. It is […]

Javascript InnerText property

Posted on November 23rd, 2015 by Devi Das

Javascript innerText property in mozilla does not work, there is an alternative to get the innerText. Javascript innerText property doesn’t work in Mozilla Firefox. So if you are writing document.getElementById(“elementID”).innerText then it might work and give you some value in IE but you will get undefined value in Mozilla Firefox. So can we use innerHTML […]

How to get the Day name (Sunday – Saturday) of any date, using a mathematical formula

Posted on November 23rd, 2015 by Jeetendra Dhal

The following example function in javascript uses a mathematical formula to get the total number of days then with MOD of 7 helps us to retrieve the day of any date. This also handles issues like leapyear and makes the calculation quicker compare to other techniques. <html> <head> <script language=”javascript”> /* * This function returns […]

How to compare start and end time in JavaScript

Posted on November 23rd, 2015 by Dipak Panda

Think of a form where we have entries for start and end time. There obviously we need to check that the end time should be after start time. Here at this point we will need to compare time and preferably that in client side(using Javascript). In Javascript comparing date is quite simple. Just create date […]

How to add a get/set property in a JavaScript OOP class

Posted on November 23rd, 2015 by Manish Sharma

In JavaScript we can mimic the OOP features like class(encapslation), public/private functions, static properties, inheritance(object inheritance using prototype) etc. Apart from these we can also add get/set function for a data member of class. //a sample Publication class in JavaScript. function Publication () { var _name = “”; //a private member coding convention. } //Define […]

How to add HTML code dynamically from Java file in Wicket

Posted on November 23rd, 2015 by Pranav Kumar

The following steps can be used to add HTML code dynamically, from a Java file in Wicket 1. First store the required html code as a String variable. 2. Create a Label instance by passing the above String in the constructor of the Label. 3. Set “EscapeModelStrings” false for the Label. label.setEscapeModelStrings(false); 4. Add a […]

Round your corners without using images in IE

Posted on November 23rd, 2015 by Sachin Kumar

Creating rounded corners in pure CSS is pretty simple and straight forward.  The following lines of code demonstrate it. -moz-border-radius:10px; / Firefox / -webkit-border-radius:10px; / Safari and chrome / -khtml-border-radius:10px; / Linux browsers / border-radius:10px; / CSS3 / If we write the above CSS for any element (say a div), it works fine for every […]

Find out if you browser supports HTML5 or not

Posted on November 23rd, 2015 by Manoranjan Mohapatra

HTML5 is the future of the web so one can start implementing it from now onwards as some of the browsers are compatible with it(not completely). However, while implementing you should take care of those browsers also which are not compatible with HTML5. The are several ways to detect whether your browser supports HTML5 element […]

Speeding Up Data Entry using ‘Autofocus’ with HTML5

Posted on November 23rd, 2015 by Subhabrata Bhattacharjee

The data entry can easily be made fast if we can put the user’s cursor in the first field on the form. HTML5 has a awesome and very brief solution of this issue. We can use autofocus attribute to any form field as shown below – <input type = “text” name = “first_name” autofocus id […]

How to play multiple videos in a loop using HTML5 and JavaScript

Posted on November 23rd, 2015 by Sourabha Sahoo

You can play multiple videos one after another in a loop using HTML5 and javascript. Using “ended” event you can detect when a HTML5 <video> element has finished playing. Steps: Place the HTML5 video tag inside the body.You can also add “autoplay” attributes to start playing automatically. <video controls id=”myVideo” > </video> Then you can […]

Reducing Object references with WITH

Posted on November 23rd, 2015 by Arup Sahoo

As the Servoy’s code editor supports Javascript and in-line Java, you can use almost all the Javascript keywords with in Servoy. Among the powerful Javascript keywords, “WITH” keyword is used to reduce Object references in your code dramatically. You can also make your code more readable by using WITH. This TIP will explain you the […]

How to display a Digital watch with Current Date on a Web page using JavaScript

Posted on November 23rd, 2015 by Rasmita Mohanty

Sometimes in our web applications we need to display current date and time , there are various ways and methods to display date and time in a web application. Here I am going to describe one simple method to display Current date and time in a digital watch format. Here I am using JavaScript and […]