473,385 Members | 1,531 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

problem in firefox browser

hi,

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
  1. function checkAlpha(event,tfield)
  2. {
  3.    data = tfield.value;
  4.    var field = tfield.name;
  5.    fieldName = field.replace(/_/g," ");
  6.    dataRegexp = new RegExp("^([a-zA-Z/][a-zA-Z/0-9]*$)");
  7.    var matched = dataRegexp.exec(data);
  8.    if(matched != null)
  9.     return true;
  10.    else 
  11.    {
  12.     event = (window.event) ? window.event : event;
  13.     if (event.preventDefault)
  14.     {
  15.        msg = "Please Enter Charecters.";
  16.        alert('Invalid ' + fieldName +' ...!' + '\n\n' + msg);
  17.        event.preventDefault();
  18.  
  19.      } 
  20.     else
  21.     {
  22.        msg = "Please Enter Charecters.";
  23.        alert('Invalid ' + fieldName +' ...!' + '\n\n' + msg);
  24.        event.returnValue = false;
  25.        return false;
  26.     }
  27.    }
  28.  }

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]
Mar 14 '07 #1
2 1365
r035198x
13,262 8TB
hi,

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 >>>>>>>>>>>>>>>>

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 >>>>>>>>>>>>>>>
<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>
Java != Javascript

Moved to Javascript forum.
Mar 14 '07 #2
Logician
210 100+
hi,

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...
This is a common question and the answer is always the same. Alerting on blur is very poor practice, as it can cause mis-operation and difficulty abandoning a form. Alert any errors on submit, or annunciate errors in an unobtrusive way.

You're welcome in advance.
Mar 14 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: R. Rajesh Jeba Anbiah | last post by:
In IE, I could be able to directly refer the "id", but it isn't possible in Firefox. Somewhere I read the solution is to refer the id like document.getElementById("month") in Firefox. If I do so,...
34
by: Simon Wigzell | last post by:
document...focus() will scroll the form to move the specified text field into view on everything I have tried it with except Safari on the MAC. The form doesn't move. Any work around? Thanks.
13
by: Giggle Girl | last post by:
Hi there, I am having a problem with the behavior of Firefox, where lefthand column content is not resized properly after it is "collapsed" and then "re-expanded". An online demo is available...
18
by: len.hartley | last post by:
Hi, I am trying to pop-up a window when the user clicks on an image. The problem is that when the user clicks on the image and the window pops up OK, but the window underneath also proceeds to...
0
by: shantibhushan | last post by:
Hi I am facing specific problem with firefox browser. I have integrated payment gateway in my website. it is working fine in internet explorer. But I am facing problem with firefox and opera...
7
by: Xah Lee | last post by:
Look at this page http://xahlee.org/emacs/wrap-url.html Look at it in Firebox, look at it in Safari, in Opera, and look at it in Microsoft Internet Explorer. The only fucked up case, is...
7
by: =?Utf-8?B?bW9mbGFoZXJ0eQ==?= | last post by:
Hi! I am trying to finish a site, but I can't seem to overcome this problem. It appears that FireFox cannot see the CSS style sheet. Here is the test site: ...
16
by: Eric | last post by:
I have a user of a web application written in Java/JSP that is unable to login to the site simply because certain links on the page do not run when they are clicked. Other popups using Javascript...
3
by: willyWEB66 | last post by:
Hi everyone, I'm having problem with the sequence of execution for xml.onload. It works fine if your not passing parameters to onload event but my code needs to pass parameter to its function. I'm...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.