• Home
  • Tools
    • Color Chart
  • Software
    • Windows tricks
      • Windows 11 Speed Up Tricks
      • Windows Command Prompt CMD
    • Android Phone
      • Android – Dangerous Settings to Turn Off
    • Projects
      • Copy Files
      • Php Autoscript
      • Web Tools
  • Payments
  • Notes
  • System Tips

Notes

ACCESS 2022 | Browsers | Css | Htacess | Html | Html5 | Javascript | Microsoft Excel | Mysql | Mysql Dumps | Php | Vb.net | VBscript | Windows <=8 | Windows >=10 | WP | WP Plugin | WP Themes | _Misc Software |

ABCDEFGHIJKLMNOPQRSTUVWXYZ
ON
PRT
OFF

<- Look Inside Data
Conditions:
Order:
35 Language Operation Title
Keywords
Application
Code Languageid
Show Html
Show Iframe
Make Public
Viewed
Viewed Date
Javascript Archive Gps Google Map Copy
gps
Google Map Calculations Backup
Javascript



1
02/20/2026
Javascript Controls List Box Controls Another Listbox And Fills In A Text Box
list box text box onchange header dropdown
Search & PHPScript 2025/12
Javascript



2
09/09/2023
Javascript Customizing How To Setup TinyMCE Text Editor
text editor
Scripture View
Javascript



3
10/27/2025
Javascript Date Check For Valid Date
valid date
Sample html:




Valid date format: mm/dd/yyyy




The Script:
Javascript



1548
09/09/2023
Javascript Date Preload Current Date Into Text Box
form current date
Javascript



4
09/09/2023
Javascript Form Input - First Caps
capital first onblur
Javascript



1596
09/09/2023
Javascript Form Form Fields - Events
form events onchange
Javascript



2027
01/03/2026
Javascript Form Prompt For
prompt input
Back in the day, you'd often see prompts on personal webpages asking for your name. After you typed in the information, you would be greeted with a page that had a welcome message, such as, "Welcome to My Personal WebPage John Schmieger!" (If your name just so happened to be John Schmieger).

The JavaScript prompt is not very useful and many find it slightly annoying, but hey, this tutorial is here to educate you, so let's learn how to make that prompt!

Simple JavaScript Prompt
You can use a prompt for a wide variety of useless tasks, but below we use it for an exceptionally silly task. Our prompt is used to gather the user's name to be displayed in our alert dialogue box.

HTML & JavaScript Code:






Display:

Recap on JavaScript Prompt
It sure is a quick way to gather some information, but it is not as reliable an information gatherer as other options available to you. If you want to find out someone's name and information, the best way to request this information would be through the use of HTML Forms. And if you want to use the information you collected in your website, you might use some PHP to get that job done in a more sophisticated manner.
Javascript



1477
09/09/2023
Javascript Form Select- Combo Box
index combo
function message(form){
var value = form.payment.options[form.payment.selectedIndex].value;
var message="";
if(value=="PHONE"){
message="Complete your order by scrolling to the bottom of this page and clicking the NEXT button.\n\n That will complete your order and provide you with your order number and total.\n\n I accept Visa or MasterCard.\n\n Call Denise at 970-454-2152 or cell phone at 970-590-2162.\n\n I will need your order # and the total amount of your order. Please provide me with your credit card number, expiration date, and the last 3 digits of the number on the back of your card.\n\n I also need the billing address of the credit card if you did not provide it on the order form. If for some reason I am unable to take your call, please leave me a message and I'll call you back as soon as possible. You may leave this information on my answering machine.\n\n Please call between 7:30am and 9:30pm (Mountain Standard Time) 9:30am and 11:30pm (Eastern Standard Time).\n\n Thank You.";
}
if(value=="CHECK"){
message="You have selected pay by check";
}
if(value=="MONEY ORDER"){
message="You have selected MONEY ORDER";
}
if(value=="PAYPAL"){
message="If you are paying by credit card with our secure online page, we accept Visa, MasterCard, Discover and American Express.\n\nIf you do not receive a confirmation email after completing the credit card payment, we will not be notified either. Contact us to confirm your order.";
}
alert (message);
}
*************



[example 2]

How do I find the value of a SELECT element?
Apr 17th, 2000 16:04
Martin Honnen,




NN6 and IE4+ provide a
value
property for SELECT elements thus
document.formName.selectName.value
is sufficient with these browsers. For other browsers and cross browser
code use
var select = document.formName.selectName;
var value = select.options[select.selectedIndex].value

__________________________________
[select name='navi' onChange="go()">
function go()
{
box = document.forms[0].navi;
destination = box.options[box.selectedIndex].value;
if (destination) location.href = destination;
}
____________________________________________________
Where: qxq-features.php
Javascript



1752
10/05/2024
Javascript Form Select - Check To See If Your Select Has Been Used
select form javascript getelementbyid
If you have a select element that looks like this:


Running this code:
var e = document.getElementById("ddlViewBy");
var strUser = e.options[e.selectedIndex].value;

Would make strUser be 2. If what you actually want is test2, then do this:
var e = document.getElementById("ddlViewBy");
var strUser = e.options[e.selectedIndex].text;

Which would make strUser be test2

var e = document.getElementById("ddlViewBy");
var SELIndex = e.selectedIndex
if (SELIndex==0){
error_message = error_message + '*Select something from xx.\n';
error = 1;
}

if you want to see if the select has nothing selected.?





javascript code:
var e = document.getElementById("comoperationid");
var SELIndex = e.selectedIndex
if (SELIndex==0){
error_message = error_message + '*Select something from operationid.\n';
error = 1;
}
Javascript



763
12/27/2025
Javascript Formatting Div - Hide A Layer
hide div layer class getElementById getElementsByClassName
Usage
Want to try it out? Here's how.

Step 1
Place this code between the tags in your webpage.



Step2
This is example html you can use, this goes inside your html body.

Try these: show a1
show a2
show a3
show 'thiscanbeanything'







Sample text:


Jean-Paul Sartre, (1905-1980) born in Paris in 1905, studied at the �cole
Normale Sup�rieure from 1924 to 1929 and became Professor of Philosophy at Le Havre
in 1931. With the help of a stipend from the Institut Fran�ais he studied in Berlin
(1932) the philosophies of Edmund Husserl and Martin Heidegger. After further teaching
at Le Havre, and then in Laon, he taught at the Lyc�e Pasteur in Paris from 1937 to 1939.
Since the end of the Second World War, Sartre has been living as an independent writer.





More on JPS


The conclusions a writer must draw from this position were set forth in
"Qu'est-ce que la litt�rature?" (What Is Literature?), 1948: literature is
no longer an activity for itself, nor primarily descriptive of characters
and situations, but is concerned with human freedom and its (and the author's)
commitment. Literature is committed; artistic creation is a moral activity.








Yet more content. This can be anything in here, html, pictures.. flash ...





This content is in a div with id "thicanbeanything"


Sartre is one of those writers for whom a determined philosophical position is the
centre of their artistic being. Although drawn from many sources, for example,
Husserl's idea of a free, fully intentional consciousness and Heidegger's existentialism,
the existentialism Sartre formulated and popularized is profoundly original.
Its popularity and that of its author reached a climax in the forties, and Sartre's
theoretical writings as well as his novels and plays constitute one of the main inspirational
sources of modern literature. In his philosophical view atheism is taken for granted; the
"loss of God" is not mourned. Man is condemned to freedom, a freedom from all authority,
which he may seek to evade, distort, and deny but which he will have to face if he is to
become a moral being. The meaning of man's life is not established before his existence.
Once the terrible freedom is acknowledged, man has to make this meaning himself, has to
commit himself to a role in this world, has to commit his freedom. And this attempt to
make oneself is futile without the "solidarity" of others.



Classes


if it is a class.


compared to if it is an id.
Javascript



1874
11/21/2025
Javascript Formatting Converting Numbers To Strings Using ToFixed()
fixed decimal places number format
Question: When I convert numbers to strings, can I guarantee exactly n decimal places in the resultant string?

Answer: The simplest way of converting a number variable to string is to concatenate the variable with an empty string. However, this conversion does not guarantee the number of decimal places in the string. If you want exactly n decimal places in the conversion result, use the toFixed method, like this:

str = x.toFixed(n);

Here x is the number to be converted, the string str is the conversion result, and n specifies how many fractional decimal places must appear in the resultant string. The method can also be used without the parameter n - you can simply write: x.toFixed(), which is equivalent to x.toFixed(0). Consider these examples:

var x = 2.31;
var s = x.toFixed() // result: '2'
var s0 = x.toFixed(0) // result: '2'
var s1 = x.toFixed(1) // result: '2.3'
var s2 = x.toFixed(2) // result: '2.31'
var s3 = x.toFixed(3) // result: '2.310'
var s4 = x.toFixed(4) // result: '2.3100'

The toFixed method might not always ensure the correct rounding of the conversion results. For example, (0.947).toFixed(0) may produce either '0' or '1', depending on the browser; in most versions of Microsoft Internet Explorer (0.947).toFixed(0) produces '0' while in Mozilla Firefox or Google Chrome the same conversion produces '1'. Below are the actual conversion results in your browser:

(0.947).toFixed(0) // '0' ('0' in MSIE, but '1' in Firefox)
(0.0947).toFixed(1) // '0.0' ('0.0' in MSIE, but '0.1' in Firefox)
(0.00947).toFixed(2) // '0.00' ('0.00' in MSIE, but '0.01' in Firefox)
(0.000947).toFixed(3) // '0.000' ('0.000' in MSIE, but '0.001' in Firefox)

For correct rounding, use the Math.round method or Math.round in combination with toFixed like this:
x=0.947; s0=(Math.round(x)).toFixed(0) // '1'
x=0.0947; s1=(Math.round(10*x)/10).toFixed(1) // '0.1'
x=0.00947; s2=(Math.round(100*x)/100).toFixed(2) // '0.01'
x=0.000947; s3=(Math.round(1000*x)/1000).toFixed(3) // '0.001'
Javascript



1552
09/09/2023
Javascript Function List Of Functions
javascript functions
Javascript



2025
09/09/2023
Javascript Function Insert Commas In Your Number As You Type
insert comma
function addCommas(nStr)
{
nStr += '';
x = nStr.split('.');
x1 = x[0];
x2 = x.length > 1 ? '.' + x[1] : '';
var rgx = /(\d+)(\d{3})/;
while (rgx.test(x1)) {
x1 = x1.replace(rgx, '$1' + ',' + '$2');
}
return x1 + x2;
}
_________________________________
[As you type]
example IWS-order_productsSub.php

function checkit(id1){
var key1= window.event.keyCode
if (key1>57 || key1<48){
return;
}
document.getElementById('li'+id1).checked=true;
nStr=document.getElementById(id1).value;
var start1=1000;
while(start1!=-1){
start1= nStr.indexOf(",");
nStr=nStr.replace(",","");
}
nStr += '';
x = nStr.split('.');
x1 = x[0];
x2 = x.length > 1 ? '.' + x[1] : '';
var rgx = /(\d+)(\d{3})/;
while (rgx.test(x1)) {
x1 = x1.replace(rgx, '$1' + ',' + '$2');
}
document.getElementById(id1).value=x1+x2;
}
Javascript



1345
09/09/2023
Javascript Function Load Popup Window
open window popup
Javascript



1758
09/09/2023
Javascript Function GetElementById
getelementbyid get element by id
Javascript



1251
09/09/2023
Javascript Function Confirm()
yes no cancel message box
Javascript



2000
09/09/2023
Javascript Function Is Javascript Enabled
enable javascript
JavaScript - Is it Enabled?
This lesson will first teach you how to enable JavaScript in Internet Explorer, Firefox, and Opera, then show you how you can write a very simple script to separate website visitors who don't have JavaScript enabled from those who do.

Advertise on Tizag.com
Enable JavaScript - Internet Explorer
In Internet Explorer 6/7 (download Internet Explorer), you can check to see if JavaScript is enabled by navigating to the custom security settings that are somewhat buried (don't worry; we'll help you find it).

1.Click on the Tools menu
2.Choose Internet Options... from the menu
3.Click the Security tab on the Internet Options pop up
4.Click the Custom Level... button to access your security settings
5.Scroll almost all the way down to the Scripting section
6.Select the Enable button for Active scripting
7.Click OK to finish the process
8.Click Yes when asked to confirm

Enable JavaScript - Firefox
In Firefox 2 (download Firefox) you can check to see if JavaScript is enabled by navigating to the Content settings under Options.

1.Click on the Tools menu
2.Choose Options... from the menu
3.Click the Content tab in the Options pop up
4.Make sure that Enable JavaScript is checked
5.Click OK to finish the process

Enable JavaScript - Opera
In Opera (download Opera) you can check to see if JavaScript is enabled by navigating to the Content settings under Preferences.

1.Click on the Tools menu
2.Choose Preferences... from the menu
3.Click the Advanced tab in the Preferences pop up
4.Select Content from the list of items on the left
5.Make sure that Enable JavaScript is checked
6.Click OK to finish the process
JavaScript Detection
These days, it's basically impossible to navigate the web without a JavaScript-enabled browser, so checking whether or not a user has JavaScript enabled is not all that important. Chances are, the only way it be disabled is if the company's IT staff has decided to disable JavaScript for some reason. However, if you still want to be sure your users are JavaScript enabled, this script will get it done.

The only sure fire way to separate users who don't have JavaScript from those who do is to use a simple redirect script that will only work for those with JavaScript enabled. If a person's browser does not have JavaScript enabled, the script will not run, and they will remain on the same page.

JavaScript Code:

Replace the example URL with the webpage of your choice
Javascript



1211
09/09/2023
Javascript Function While Loop
while loop
Javascript



1170
09/09/2023
Javascript Function Comment Out Lines
comment rem
Creating Single Line Comments
To create a single line comment in JavaScript, you place two slashes "//" in front of the code or text you wish to have the JavaScript interpreter ignore. When you place these two slashes, all text to the right of them will be ignored, until the next line.

These types of comments are great for commenting out single lines of code and writing small notes.

JavaScript Code:


Display:
I have comments in my JavaScript code!
Each line of code that is colored red is commented out and will not be interpreted by the JavaScript engine.

Creating Multi-line Comments
Although a single line comment is quite useful, it can sometimes be burdensome to use when disabling long segments of code or inserting long-winded comments. For this large comments you can use JavaScript's multi-line comment that begins with /* and ends with */.

JavaScript Code:


Display:
I have multi-line comments!
Quite often text editors have the ability to comment out many lines of code with a simple key stroke or option in the menu. If you are using a specialized text editor for programming, be sure that you check and see if it has an option to easily comment out many lines of code!
Javascript



1507
09/09/2023
Javascript Function Date And Time
date time
Javascript



1569
09/09/2023
Javascript Function Determine If An Array Checkbox Or Radiobutton Has Been Checked
checkbox array radio button checked
Checkboxes can be used as arrays and the value can be collected using JavaScript. We will be discussing client side JavaScript and the collection of checkbox value. You can visit the php section for checkbox array handling using PHP server side scripting. We can create a group of checkbox by giving them the same name and that will create an array and from it we can collect the names of the check boxes for which it is checked.

Here are some commands we will be using to get the details of the events or actions we perform.

document.form1.scripts.length

This gives us the length of the array or the number of elements present in the array. If we know we are using 5 checkboxes then we can directly use the number 5 but it is a good to use this as this picks up all the checkboxes of the group without missing any checkbox. Note that the word scripts in the document.form1.scripts.length is the name of the array and same as the checkboxes name.
document.form1.scripts[i].checked

The above command will return true if the checkbox is checked so we will use one if condition to know it is checked or not. The value of i is the index of the array and as we will be using one for loop so the value of i will be changing upto the maximum value. Here is the demo of the script. SexMale Female
Scripts You knowJavaScript PHP HTML

The JavaScript code is kept within the head tag of the page.



To display the period button and checkboxes see the code below. BODY










SexMale Female
Scripts You knowJavaScript PHP HTML
Javascript



1648
09/09/2023
Javascript Function Label - Changing A Label On A Web Page
update label update caption innerHTML
Javascript



1365
09/09/2023
Javascript Function SELECT - Using To Update Page
combo redirect url location href wordpress getelementbyid window open
Javascript



1650
10/05/2024
Javascript Function GetElementById
javascript form tags id= SWD
J = InStr(CODE2, "## " + "##") : CODE2 = Left(CODE2, J - 1)
For J = 0 To TMPA.Count - 1
If InStr(CODE2, "##" + TMPA(J) + "##") = 0 Then NotFound = True : CODE2 = CODE2 + "##" + TMPA(J) + "##" + vbCR
Next
CODE2 = CODE2 + "## " + "##" + vbCR
If NotFound = True Then My.Computer.FileSystem.WriteAllText(Tree2 + Filename + "Code.txx", CODE2, append:=False)
Javascript



1010
09/09/2023
Javascript Function Bearing
Bearing heading latitude longitude
GPS
Javascript



2
09/09/2023
Javascript Language For Statement
for
Loops
Javascript



2
09/09/2023
Javascript Link Using A Button As A Hyperlink
button hyperlink
With an ordinary HTML link using the tag you can target the page that the link refers to so that it will display in another window or frame. Of course the same can also be done from within Javascript.

To target the top of the current page and break out of any frameset currently in use you would use
in HTML. In Javascript you use:

top.location.href = 'page.htm';
To target the current page or frame you can use
in HTML. In Javascript you use:

self.location.href = 'page.htm';
To target the parent frame you can use
in HTML. In Javascript you use:

parent.location.href = 'page.htm';
To target a specific frame within a frameset you can use
in HTML. In Javascript you use:

top.frames['thatframe'].location.href = 'page.htm';
To target a specific iframe within the current page you can use
in HTML. In Javascript you use:

self.frames['thatframe'].location.href = 'page.htm';
or
parent.right.location.href= `Loads file into window or frame right`
Javascript



1624
09/09/2023
Javascript Object .select(); Clipboard
Clipboard object of document.getElementById().select;
Javascript



0
07/29/2022
Javascript Printing Print Web Page
print button
The JavaScript print function window.print() will print the current webpage when executed. In this example script, we will be placing the function on a JavaScript button that will perform the print operation when the onClick event occurs.

HTML & JavaScript Code:


Javascript



1423
09/09/2023
Javascript String String Manipulations
replace indexof substring length
indexOf:
var ss = "a string index of test ";
var result = ss.indexOf("ri");

length:


Replace Function: Global Regular Expression
By enabling the global property of our regular expression, we can go from replacing one match at a time to replacing all matches at once. To enable the global property, just put a "g" at the end of the regular expression.

replace:

Display:
Old string = Hello username! I hope you enjoy your stay username.
New string = Hello Chuck! I hope you enjoy your stay Chuck.

substring:

The output of the code above will be: lo w

Question: How do I convert numbers to strings in JavaScript?

Answer: The simplest way to convert any variable to a string is to add an empty string to that variable (i.e. concatenate it with an empty string ''), for example:


a = a+'' // This converts a to string
b += '' // This converts b to string

5.41 + '' // Result: the string '5.41'
Math.PI + '' // Result: the string '3.141592653589793'
Javascript



1246
09/09/2023
Javascript String Array Information
length array size count
Javascript



1296
09/09/2023
Javascript Text Box Auto Clear Text Box
Input text - auto clear
w






FIND A STORE




onblur="this.value=(this.value=='') ? 'Enter a Zip Code' : this.value;"
onfocus="clearText(this);" value="Enter a Zip Code" />
Javascript



1460
09/09/2023
Javascript Text Box Move To Next Field Automatically When Textbox Is Full
auto move text box event keycode focus
function moveOn(field,nextFieldID,e){
var unicode=e.keyCode? e.keyCode : e.charCode
if(unicode!=39 && unicode!=37){
if(field.value.length >= field.maxLength){
document.getElementById(nextFieldID).focus();
}
}
}


-
-
";
Javascript



1542
09/09/2023
Javascript Variables Using Math In Functions
float integer math parse gps distance heading bearing
Javascript Math
function getPointAtDistance(lat1, lon1, distance, bearing) {
const R = 6371e3; // Earth's radius in meters
const d = distance; // Distance in meters

const lat1Rad = toRadians(lat1);
const lon1Rad = toRadians(lon1);
const brngRad = toRadians(bearing);

const lat2Rad = Math.asin(
Math.sin(lat1Rad) * Math.cos(d / R) +
Math.cos(lat1Rad) * Math.sin(d / R) * Math.cos(brngRad)
);

const lon2Rad = lon1Rad + Math.atan2(
Math.sin(brngRad) * Math.sin(d / R) * Math.cos(lat1Rad),
Math.cos(d / R) - Math.sin(lat1Rad) * Math.sin(lat2Rad)
);

return {
latitude: toDegrees(lat2Rad),
longitude: toDegrees(lon2Rad)
};
}

function toRadians(deg) {
return deg * (Math.PI / 180);
}

function toDegrees(rad) {
return rad * (180 / Math.PI);
}

===================
function toRadians(degrees) {
return degrees * Math.PI / 180;
}

// Converts from radians to degrees.
function toDegrees(radians) {
return radians * 180 / Math.PI;
}

function bearing(startLat, startLng, destLat, destLng){
startLat = toRadians(startLat);
startLng = toRadians(startLng);
destLat = toRadians(destLat);
destLng = toRadians(destLng);

y = Math.sin(destLng - startLng) * Math.cos(destLat);
x = Math.cos(startLat) * Math.sin(destLat) -
Math.sin(startLat) * Math.cos(destLat) * Math.cos(destLng - startLng);
brng = Math.atan2(y, x);
brng = toDegrees(brng);
return (brng + 360) % 360;
}
function distanceHeading(lat1,lon1,lat2,lon2){
var distance=getDistanceFromLatLonInKm(lat1,lon1,lat2,lon2);
var heading=bearing(lat1,lon1,lat2,lon2);
alert(distance+" -> "+heading+" degrees");
var complete=lat1+","+lon1+"; "+distance+" -> "+heading+" degrees; "+lat2+", "+lon2+"nn";
document.getElementById("piled").value=document.getElementById("piled").value+complete;
}
function circleDistance(lat1,lon1,lat2,lon2){
var distance=getDistanceFromLatLonInKm(lat1,lon1,lat2,lon2);
var distance100=2*3.141596*parseFloat(distance);
var width=60/43560;
var distance50=distance100/2;
var distance25=distance100/4;
alert("full circle="+parseInt(distance100)+" ft ==== half circle="+parseInt(distance50)+" ft ====== quarter circle="+parseInt(distance25)+" ft");
alert("full circle area="+distance100*width+" acre ==== half circle area="+distance50*width+" acre ====== quarter circle area="+distance25*width+" acre");
}
Javascript



1
02/20/2026

Software Web Design