Blog Archives

You can learn here basics about javascript.

For using javascript Calendar in web page

1. To use calendar in our page, we should include one JS file in our project on the same path of our page. 2. Paste the following line in <head> <SCRIPT LANGUAGE=”JavaScript” SRC=”CalendarPopup.js”></SCRIPT> <SCRIPT LANGUAGE=”JavaScript” ID=”js1″> var cal1 = new

Posted in Javascript Tagged with: ,

Detecting browser type using javascript

Many different browsers (e.g FireFox, IE,chrome,opera,safari)are available for displaying webpages. Each and every browser will have their own way of rendering content of webpage, and script (e.g javascript) execution also will vary based on the script engine implemented with them.

Posted in Javascript

Javascript validation for radio button in HTML form

HTML is having INPUT tag withradio as type to display radio button in the HTML form. Multiple input tags should be given same name to make it one group. Consider below code which will allow the user to select any one

Posted in Javascript Tagged with: ,

Javascript print() function

Javascript window.print() used to take print the current web page.When the user click ‘Print’ button the user will get the print window. Code: <head> <script language="javascript"> function takeprint() { window.print(); } </sctipt> </head> <body> <input type="button" name="print" value="Print" onClick="javascript:return takeprint();">

Posted in Javascript

Solution for fixing trim() function in javascript not working in IE

Solution for fixing trim() function in javascript not working in IE I tired to apply trim() function in Javascript for one of my code. Its working fine under mozilla. But error display once I tried in IE7. I have tried

Posted in Javascript

Dynamically adding text box using javascript

Some times we need to add text box dynamically in a web page. For example, assume that our web page is having option to add email id of many friends. It is very difficult to judge how many friends will

Posted in Javascript

JavaScript Search

The search() method searches for a match between a regular expression and a string. This method returns the position of the match, or -1 if no match is found. Syntax string.search(regexp) Let’s see small example, <script language="javascript"> function findmatch() {

Posted in Javascript

JavaScript split

The split() method is used to split a string into an array of substrings, based on a character that divides the parts. The character that divides the parts could be many things, ex – a comma, a slash, a pipe

Posted in Javascript

JavaScript Form Validation

JavaScript can be used to validate data in HTML forms before sending off the content to a server. JavaScript also lets you display helpful alerts to inform the user what information they have entered incorrectly and how they can fix

Posted in Javascript

Javascript innerHTML

The innerHTML property can be used to modify your document’s HTML on the fly. If you want to access the text within a non-input HTML element, then you are going to have to use the innerHTML property instead of value.

Posted in Javascript