<SCRIPT language="JavaScript" type="text/javascript">
<!--
function emailink(){
window.location = "mailto:"+"?subject=Hi, this web page might interest you..." + "&body="+window.location.href;
}
//-->
</SCRIPT>
Insert this anywhere on the web page
<a href="javascript:emailink()">Recommend
this Page to a Friend!</a>
2. Clear Text Box
Help your visitors fill-out a your form box by placing instructions in the
box field. When the user clicks the field, the text instantly clears from the
box. Also quite uniquely for this type of script, when the box is left empty and the user clicks elsewhere, the pre-set text returns.
Demo:
Codes:
Insert within your current form
<input type="text" size="30" name="box"
value="Type your name here" onfocus="javascript:if(this.value=='Type
your name here') {this.value='';}" onblur="javascript:if(this.value=='')
{this.value='Type your name here'}">
3. Select All Text Box
Allows the user to Copy & Paste the contents of a text
box.
Demo:
Codes:
Insert between <HEAD> and </HEAD>
<SCRIPT language="JavaScript" type="text/javascript">
<!--
// Script Source: www.insighteye.com
function selectAll(theField) {
var tempval=eval("document."+theField)
tempval.focus()
tempval.select()
}
//-->
</SCRIPT>
If you receive error: "Method Not Allowed" then change the line method="POST"
to method="GET"
The script works in both modes.
The line:
"demo_tc_done.html"
should be the page your visitors are clicking to or a CGI script as appropriate.
7. Form Box Counter
If you have a form box that requires a certain amount of characters to be entered in the box, then this
script will give a count feature. A dialog box tells the user how many characters have been entered and
a warning if over the designated amount.
(Set for 10 characters maximum. Add 1 more character to see the effect.
Demo:
Codes:
Insert between <HEAD> and </HEAD>
<script language="JavaScript" type="text/javascript">
<!--
// Script Source: www.insighteye.com
function CheckSize(form, field) {
if (field ==1) {
Ctrl = form.test;
y = 30;
x = Ctrl.value.length;
}
if (x < y)
SendMsg (Ctrl, "OK - number of characters is: " + x); else
SendMsg (Ctrl, "Too Long - number of characters is: " + x);}
function SendMsg (Ctrl, PromptStr) { alert (PromptStr);
Ctrl.focus(); return;}
//-->
</script>
These free Javascript codes are offered at no charge for commercial and personal use and are used entirely at your own risk. These scripts are copyright and may not be reproduced without permission. License for Free Use: Script source tags in these codes may not be removed in any circumstance. Liability and Warranty Disclaimer: All Java Script's are provided "as is" and without any warranties as to performance or merchantability, or any other warranties, whether expressed or implied. All scripts are supplied free but are unsupported. Do enjoy!