Click to See Complete Forum and Search --> : how do i checkstring


pelegk1
05-05-2003, 04:04 AM
for cahrs that i want ordont want?
for example want to allow string that only contain
:

a..z#%
how do i check that?
thnaks
Peleg

in 2 days israel will be 55 years - bravo!

Charles
05-05-2003, 04:46 AM
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Content-Script-Type" content="text/javascript">
<form action="">
<div>
<input type="text" onchange="if (!/^[a-z#%]+$/.test(this.value)) {alert('That would not appear to be a valid entry'); this.value = ''; this.focus()}">
<input type="submit">
<div>
</form>

And how many years until the end of the occupation of Palestinian land?

pelegk1
05-05-2003, 05:03 AM
how to build by myself a quesry like u di : (!/^[a-z#%]+$/.test(this.value))
?
thanks in dvance
Peleg

Charles
05-05-2003, 05:09 AM
See http://developer.netscape.com/docs/manuals/js/client/jsref/regexp.htm.