I am facing problem with firefox2.0 browser,
Actually my problem is
i am validating a textfield using javascript.if the script return false then the cursor not focusing on failed text field...
but in IE it is happing like, if validation failed then cursor comes on wrong invalid textfield... and in this case we cant submit the form. this is actually my requirement. but in Firefox it is not happing like these...
i want IE requirement to firefox also...
please give the solution anybody...
thank you in advance.........
i also paste the code.....
Java script >>>>>>>>>>>>>>>>
Expand|Select|Wrap|Line Numbers
- function checkAlpha(event,tfield)
- {
- data = tfield.value;
- var field = tfield.name;
- fieldName = field.replace(/_/g," ");
- dataRegexp = new RegExp("^([a-zA-Z/][a-zA-Z/0-9]*$)");
- var matched = dataRegexp.exec(data);
- if(matched != null)
- return true;
- else
- {
- event = (window.event) ? window.event : event;
- if (event.preventDefault)
- {
- msg = "Please Enter Charecters.";
- alert('Invalid ' + fieldName +' ...!' + '\n\n' + msg);
- event.preventDefault();
- }
- else
- {
- msg = "Please Enter Charecters.";
- alert('Invalid ' + fieldName +' ...!' + '\n\n' + msg);
- event.returnValue = false;
- return false;
- }
- }
- }
form >>>>>>>>>>>>>>>
[HTML]<body onLoad="load()">
<div style= "position:relative;top:100px;left:200px;font-size:17;color:white;border-style:none">
<form name = "backup_form" action="/pce/backupwrite">
<table class = "text_input" border="0">
<tr>
<td align="left">
Backup Location:
</td>
<td>
<input type = "text" name = "Backup_Location" id = "backup_location" onChange="checkAlpha(event,this)">
</td>[/HTML]