Get programming code snippets and tips for HTML, CSS, ASP, SQL, JavaScript, RSS, XML, and more
Lee's Code        A web programmer's toolbox. SEARCH SITE
HOME  |  ABOUT LEE  |  CONTACT  |  SEARCH
Home > Code

Navigation

Latest Additions

SQL Injection Data Cle...
HTML box with rounded ...
Classic ASP Timer usin...
Lorem Ipsum Text Fille...
JavaScript Page Redire...
 


Links


 

Recommendations

Evolve Online
Powered by
Evolve Online
 

Lee's Code:

Language  Type  Rating  Description 
ASP  Code    ASP - Select Random Records from a data table
Many ASP programmers write complicated code to simulate a random selection of items from an open recordset. This is often done by reading all the records into a... more
 
ASP  Code    ASP Break Cache
When you update a data on a data-driven page then redirect a user to it, you want to ensure the web browser displays current content instead of cached content.... more
 
ASP  Code    ASP Timer
This is a simple script to demonstrate how to time an activity in ASP and display the results.... more
 
ASP  Code    Calculate a Person's Age
How do you calculate a person's age in ASP? You might think the DateDiff function would work if you use the year (yyyy) option. But it doesn't work right be... more
 
JavaScript  Tip    Change CSS Property via javaScript
Typically, CSS attributes are represented as properties in a style sheet. They may also be coded directly into an html tag. For example: <div Style="font-wei... more
 
JavaScript  Code    Change the URL in Opening Window
This script is useful when you open a popup window and you need it to change the URL in the window which opened it. When the user clicks on a link or an image t... more
 
ASP  Code    Check Credit Card Validity in ASP
This routine was actually written by someone else but didn't work right so I modified it. It is a very simple credit card verification routine which simply appl... more
 
ASP  code    Classic ASP Timer using SQL Server
This script provides a way to cause your Classic ASP page t pause or sleep. It uses SQL Server to perform the sleep function.... more
 
T-SQL  Code    Clear Transaction Log in T-SQL
This T-SQL script will clear out a SQL Server transaction log, which will shrink the size of your database. If your database gets a lot of activity, the transac... more
 
JavaScript  Code    Count and Limit Characters in a Textarea
HTML does not provide a way to limit the number of characters which can be input to a <textarea> field in a form. This JavaScript counts and limits the nu... more
 
HTML  Code    Country drop-down list
Here is a simple drop-down list containing the countries of the world. It is suitable for a simple eCommerce application. Note that this simple list does no... more
 
ASP  Code    Country Drop-down List (with validation)
This code creates a country drop-down list with the chosen country selected. It is useful for online forms which are populated form a form post or from a datab... more
 
T-SQL  Code    Create Bill of Materials Table
This T-SQL script creates a simple Bill of Materials (BOM) table and also creates an index on the ParentSKU field.The Bill of Materials ID field (BOMID) is alre... more
 
CSS  Code    CSS Tooltip on hover
This is a simple but powerful CSS technique to display a tooltip when the mouse is over a highlighted link.... more
 
JavaScript  Code    Disable Repeat Form Submission
This little script will disable repeat form submission. It is great for shopping carts to prevent the customer from submitting their order to the credit gateway... more
 
CSS  Code    Error Box
This is a quick and easy CSS format for en error box. You can easily change the size, colors, and so on.... more
 
JavaScript  Code    Expanding and Collapsing FAQ
This code lets you create one or more areas on your web page which expand when an image or a link is clicked. The area will collapse and disappear again when yo... more
 
HTML  Tip    HTML / CSS Page Break
This is a simple bit of HTML code with CSS to force a page break when a web page is printed. However it is often not mentioned in HTML tutorials and tricks. Tha... more
 
CSS  Tip    HTML / CSS Page Break
This is a simple bit of HTML code with CSS to force a page break when a web page is printed. However it is often not mentioned in HTML tutorials and tricks. Tha... more
 
HTML  Code    HTML box with rounded corners
This little trick uses the fieldset and legend tags to create a nicely bordered box with a title. It is straight HTML. Originally this was proprietary to IE,... more
 
JavaScript  Code    JavaScript Page Redirection on a Timer
This is a simple but useful JavaScript code snippet which redirects the current page on a timer. Note the timer is in milliseconds.... more
 
HTML  Code    Lorem Ipsum Text Filler
Ever needed something to use as a placeholder for future test? Have you wondered what "Lorem Ipsum… " was all about? Here is 5 paragraphs of Latin gibberish com... more
 
CSS  Tip    Modify CSS Property via javaScript
Typically, CSS attributes are represented as properties in a style sheet. They may also be coded directly into an html tag. For example: <div Style="font-wei... more
 
ASP  Code    Open CSV File as Dataset
This script shows you how to open a CSV file as a recordset so you can read and write records. It also shows a simple method of looping through the records to p... more
 
ASP  Code    Open MS Access Database and Tables
This script demonstrates how to open a MS Access database using a file path rather than an ODBC dataset name. It also includes sample scripts to open a recordse... more
 
ASP  Code    Parse First and Last Names
A simple script I wrote years ago to parse first and last names. It is still handy.... more
 
ASP  Code    Random Number Generator
A simple function but very useful. This script will generate a random number between 1 and 1,000,000.... more
 
ASP  Tip    Read and Write Cookies in ASP
This code contains a simple example of reading and writing a cookie in classic ASP.... more
 
JavaScript  Code    Resize a window to a percent of the screen area
A simple way to resize a window to a percentage of the screen area when a link is clicked.... more
 
HTML  Code    SEO META Tags
Many people have asked for the basic HTML META tags for search engine optimization. These will get you started, and will help the search engines evaluate your p... more
 
ASP  Code    Show all Server Variables
This is a simple script to demonstrate how to read and show all server variables.... more
 
ASP  Code    Simple Form Field Validation
This is a simple example of one method for checking form field submissions in ASP. When the form is submitted, it posts back to the same page and the fields are... more
 
ASP  Code    SQL Injection Data Cleaner
This is a simple input field cleaner to help prevent SQL Injection problems. SQL Injection occurs when a hacker fills out a form on your web site or posts data ... more
 
ASP  Code    State Drop-down List (validated)
This code creates a state drop-down list with the chosen state selected. It includes US States, Canadian Provinces, and a selection for 'none' if the person doe... more
 
T-SQL  Code    T-SQL Create Commissions Table
This script creates a simple Commissions table to keep track of commissions earned and paid.... more
 
T-SQL  Code    T-SQL Shrink Transaction Log
Simple T-SQL script to shrink the transaction log for a MS SQL Server database.... more
 
ASP  Program    vCard Creator
This script will create a downloadable vCard on the fly. This version uses pre-set parameters, but the name, address, and other information could easily be set ... more
 

Lee's Code programming tips and tricks. Back to top of page.

Programming tips and tricks for ASP, javaScript, SQL, SML, CSS, HTML HOME | ABOUT LEE | CONTACT | SEARCH
 
Copyright © 2001 - 2009 by Lee A. Shurie