Ajax
ASP
C,C++
C#,.NET
CSS,HTML
Delphi,Kylix
Experience
Flash
Java
JavaScript
PHP
Python
QT
SQL
ShellScript
VB
U :
P :
Register
Lost Password
Other Links
Code Archive
Save Giovanni
JavaScript Category Code
Real Name
:
Secure Shell
Subject
:
Validate an input field with minimum and maximum values
Description
:
Validate an input field with minimum and maximum values / Girilen değerin belirlenen minimum ve maksimum değerler arasında olmasını kontrol ediyoruz.
<html> <head> <script type="text/javascript"> function validate(){ x=document.myForm txt=x.myInput.value if (txt>=1 && txt<=5) { return true }else{ alert("Must be between 1 and 5") return false } } </script> </head> <body> <form name="myForm" action="" onsubmit="return validate()"> Enter a value from 1 to 5: <input type="text" name="myInput" size="20"> <input type="submit" value="Submit"> </form> </body> </html>
Rating
:
0.00
(out of 5)
Visitor Voting Booth
:
Excellent
Very Good
Good
Fair
Poor
Copyright © 2006 SharingCode.NET . All rights reserved. Hosted By: SisNetworks