|
I'm looking for Javascript validation that will stop a ' (apostrophe) being entered into a HTML textbox form field.
Anyone have this?
Thanks
Picco
|
|
|
Hai
Please try the following code.
Here if u try to enter Apostrophe in the text box it will be remove the Apostrophe form the textbox.
is this ok for u.
if not revert mw u'r requirement.
=========================================================
<script language="JavaScript">
function checkApostrophe()
{
var tmp=document.forms[0].textboxName1.value;
if(tmp.match("'"))
{
var ne=tmp.replace("'","");
document.forms[0].textboxName1.value=ne;
}
}
</script>
<form name="formName1">
<br>
<table border="0" width="248" id="table1">
<tr>
<td width="27">
<input type="textbox" name="textboxName1" value="" size="15" onkeypress="checkApostrophe()"><br>
</tr>
</table>
<p> </p>
<p><br>
</p>
</form>
<p>
=========================================================
Thanks
|
|
|
|
|
|
|
// |