Name : Restrict Delete characters from a text box string
Description :The user can set a character that the user wants to not allow in an text box entry field. This performs the check for all text boxes on a form.
By: Duane Warsham Assumes:The user can set a character that the user wants to not allow in an text box entry field. Change the Comma declaration to the numeric code of the key you want to exclude. I have added a simple alert function to message you the codes as you type them to simplify getting the correct key code. simply remove it when you have your keycode. Dont forget to put the script tags around this code,uploading would not allow the tags in the code.
document.onkeydown = keyHit;
Comma = 188;
function keyHit(evt)
{
thiskey = window.event.keyCode;
if (thiskey == Comma)
{window.event.keyCode = 46};
alert(thiskey); // remove this line when u have the keyCode number you want to exclude
}
Restrict Delete characters from a text box string
Diposting oleh Source Code Program | 07.53 | JavaScript | 0 komentar »Window Status Bar - Link change
Diposting oleh Source Code Program | 18.51 | JavaScript | 0 komentar »<HTML>
<HEAD>
<TITLE>default Text in the Status Bar when mouse cursor is
over link</TITLE>
</HEAD>
<BODY>
Look in the status Bar and put mouse cursor over link<BR>
Planet source code<BR>
All the script is in the body of the document too!<BR><BR>
<A href="http://www.komputerprogramming.blogspot.com"
onMouseover="window.status='One of the best
places to post/get code to/from on the net!';return true"
onMouseout="window.status='';return true">'mouse over' this!</A>
</BODY>
</HTML>
sempel source code click right diabled<HTML>
<HEAD>
<TITLE>Just try to right click on me</TITLE>
</HEAD>
<SCRIPT>
<!-- JavaScript Start -----
function click() {if (event.button==2) { alert('Disabled') } }
document.onmousedown=click
----- JavaScript End ------>
</SCRIPT>
<BODY>
Just try to right click
</BODY>
</HTML>