JavaScript Sample Code
-
Adding controls to PlaceHolders dynamically
by Edward Tanguay
A simple example demonstrating how to dynamically add controls to a PlaceHolder control.
-
Dynamically Adding OPTIONS to SELECT
by Bruce Johnson
How To: Dynamically Add an OPTION to a SELECT in a browser
-
Automatically check/uncheck multiple checkboxes
by Kiran Pai
Allow a user to easily uncheck and check all the checkboxes on a form
-
How to disable all elements on a form
by Edward Tanguay
You almost always want to have your form to be disabled as soon as the user pressed the submit button so that the user doesn't accidently submit the form twice. Here's how.
-
Change Text Field Colors
by Super Tal
This function will change the colors of a form text box field.
-
Building an 'AJAX' ProgressBar in Atlas
by Wilco Bauwer
Learn how to write a basic, client-side Atlas progress bar, and download the source code.
-
Finding a string inside a larger string
by David Nishimoto
Explains how to find a string inside of a bigger string
-
How to simulate a status bar in a Web application
by Edward Tanguay
If you have a process that takes over 20 seconds or so on a Web application, you may want to let the user know the status of the process. Edward shows you how.
-
Validate Phone or Fax Number
by Pradip Patel
This is a small javascript function that can be used to validate a phone or fax number.
-
Number Validation
by Super Tal
Use this function to validate a form field to only accepts numbers.
-
Don't explicitly set the page language in ASP
by ElementK Journals
Why you shouldn't explicitly set the page language in ASP
-
Validate Currency Field
by Super Tal
Want to validate your field to only accept US currency? Try this short JavaScript function.
-
Display the Current Day of the Week
by David Nishimoto
How to display the current day of the week.
-
Animated Buttons
by Peeyush Nigam
A few more animated buttons using CSS, Javascript and DHTML to create new more interactive & cool Form Button controls. Remember the code is best suited for only IE-5.5 and above.
-
Print function
by Super Tal
This small, simple function will call the Windows print function within a browser.
-
Pre-load Images
by Peeyush Nigam
Some simple javascript to pre-load images on a web page
-
Multiple Submit Buttons
by Kiran Pai
This script shows you how to submit the contents of a form to different programs depending on which Submit button you press.
-
Open a new window
by Kiran Pai
How to open a page (existing as well as dynamic) in a new window without bars, buttons, etc.
-
Rotating Images
by David Nishimoto
Rotating Image and Dynamically Change the Link
-
MS Agent in a web site
by Warren
Ever wondered how to use the MS Agent characters from your website? This example demonstrates how, using JavaScript and VB Script