Software, your way.
burger menu icon
WillMaster

WillMasterBlog > JavaScript

Will Bontrager Blogs Website Techniques
Blogs Just In

JavaScript Articles

3 Backslash Uses in JavaScript Strings

The skilled JavaScript programmer knows these 3 uses for the backslash character by heart. No need to think. The fingers type the backslash character seemingly automatically in response to the need.

A JavaScript-In-Email Gotcha

Publishing JavaScript in email has an uncertainty, a gotcha: The software used to read the email may react unexpectedly to the script tag.

Amazon Royalties Estimator on Your Web Pages

For your website: An attractive and useful calculator. Estimate your royalties from your Amazon publications.

Default Form Field Values Assigned After Form Submission

It's easy enough to provide default information in form fields. Simply use the value="..." attribute. Yet, that may not always be an appropriate way to do it.

Different Email Destinations For Different Form User Locations

I will show you how to send email to a different destination if the form user does not specify a certain geographic location.

Donation Payment Amount Fields

How to allow only one payment amount on a form to be submitted.

Do Only Once

I'll show you how to prevent pretty much any JavaScript function from running more than once with a cookie.

Dynamic Year List Dropdown

The JavaScript automatically lists the year numbers in the dropdown in relation to the current year.

Email Address Identical Check In Form

There several ways to make it more likely a form user will type an email address correctly. One is the method at Validating Form Field Email Addresses. Another is a system where the user must validate the address by clicking on a link in an email (or reply to it) sent to the address provided on the form.

A third method, the subject of this article, is to compare 2 email form fields. The user is required to type or paste the same address in both fields.

External JavaScript

Importing JavaScript from an external file can be prudent — rather than embedding the JavaScript code in the web page.

Find Highest z-index and Lowest z-index, the z-index Range

To determine the highest CSS z-index and the lowest z-index on the page, the z-index range, use the JavaScript function zIndexRange()

Form Field Prompts

Form text fields may themselves contain a prompt indicating what information is expected. When the field is clicked on, the prompt disappears.

HTML Commented Script Code

Back in the "old" days, when some browsers did not understand JavaScript, the HTML comment tag was used to comment out the JavaScript code. Otherwise, the browser would print the code on the web page. ... Recently, however, we came full circle. The HTML comment tag is needed once more.

HTML Entities Generator

Several generators are incorporated into my personal portal page, the web page on my hard drive that is my browser's home page. One of those is an HTML entities generator. It's for those instances where I need to obfuscate some web page source code, yet have no need for high security.

Inserting An External JavaScript File Into JavaScript

When attempting to use document.write() to insert an external JavaScript file into a web page, the "script" tag within the document.write() statement can spawn an error. Here is a work-around.

Instant Required Field Check

JavaScript can do an instant check when a form is submitted and prevent the submission if required fields are empty, along with an appropriate message. No need to reload the form. Less hassle for the user.

JavaScript Validation Field Name Restrictions

When JavaScript uses a form field name to validate or otherwise manipulate the field's value, then form field name has certain restrictions.

Multiple Function Calls with One Onclick Attribute

Once in a while we receive questions like, "How do I run more than one JavaScript function with one onclick= or onsubmit= call?"

One Way to Block Form Submission Robots

They pollute forums, inundate email boxes, corrupt databases with loads of wrong information, and vie with legitimate traffic for use of the Internet. I don't know how to keep them off the Internet. But I can tell you about a way to block them from auto-submitting your forms.

Password Generator

A free password generator. Use here or copy the code and put it on your own web page.

Preventing Excessively Large Feedback/Contact Messages

Very large emails and feedback/contact messages are more likely to be ignored than short, succinct ones. I'll show you how to display a custom error message if the number of characters in the form user's message exceeds your specified limit. If the limit is not exceeded, there is no indication there was a limit at all.

Printing the Current Date with JavaScript

This JavaScript will print the current date on a web page.

'Processing' Message on Submit

How to prevent subsequent tap on submit button and let form user know their information is being processed.

Random Number With JavaScript

When you need to generate a random number with JavaScript, the RandomNumber() function can be used. RandomNumber() expects two values, the minimum number and the maximum number and returns a random number within that range.

Running A JavaScript Function Every So Often

Sometimes, it is desirable to run a certain JavaScript function every so often on a web page. A clock update or an image rotation are possibilities.

Spamming You Through Your Own Forms

Are you getting spammed through your own web page forms? If not, remember willmaster.com for when it does happen. They have a solution.

Strings with Line Breaks in JavaScript

Strings containing literal line breaks can break JavaScript code. This article provides several ways to deal with line breaks when assigning strings to a variable and when writing strings with document.write() or document.writeln().

How Can We Help You? balloons
How Can We Help You?
bullet Custom Programming
bullet Ready-Made Software
bullet Technical Support
bullet Possibilities Newsletter
bullet Website "How-To" Info
bullet Useful Information List
Chamber of Commerce - on the Web logo

© 1998-2001 William and Mari Bontrager
© 2001-2011 Bontrager Connection, LLC
© 2011-2024 Will Bontrager Software LLC