sourav sen

Greenhorn
+ Follow
since Jul 01, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by sourav sen

I'm developing a website using PHP, Javascript and MySQL.

I have a login form with a couple of textboxes and a login button. What I
want to do is capture the Enter key so that when the user presses Enter, it will behave like tab and throw the onchange event (written for each field).

I have searched the Internet for hours now trying to find out how to do it,
but any methods that I have seen do not work.

Can anyone help me do that?

Regards,
Sourav
hi,

I'm facing a problem in Mozilla which is ok in Ie.

I have few input boxes in my page. After entering some text in one field and pressing the enter key, Onchange event is called for every wrong input and cursor goes back to re-enter the text. In Mozilla when enter key is pressed it first called the onchange event and then simultaneously calling the onsubmit function written in Javascript. In IE it is not throwing the onsubmit event before going to the next field unless it is the last field of the page.
What is the problem in Mozilla?

Please suggest necessary soultion.

Regards,

Sourav
Hi,
It is also not working with document.formname in Mozilla. I have tried the setTimeout function but what happened in Mozilla, it selects the text box value after showing error message but mouse cursor can be moveable to the next field which is not occuring in IE.

Thanks & Regards,

Sourav
Hi...

It's on onchange="return Climit();"

Regards,

Sourav
function Climit()
{

var find=/[0-9\*\=\_\>\<\:\@\&\%\?\$\)\(\`\~\#\^\|\+\.\,\;\\\}\{\]\[\\"\!\/\-\']/;
var maxchars=20;

if(document.personal.person_name.value.length > maxchars)
{
alert('Too much data in the text box! Please remove '+
(document.personal.person_name.value.length - maxchars)+ ' characters');

window.document.personal.person_name.focus();
window.document.personal.person_name.select();
return false;
}


else if(document.personal.person_name.value.search(find)!= -1)
{
alert("Only letters are allowed.");
window.document.personal.person_name.focus();
window.document.personal.person_name.select();
return false;
}
else
return true;
}
Hi Eric,

Thanks for the reply.

I have used that code already, it is not working in Mozilla when onchange event is throwing error message. The mouse cursor is moving to the next text field after showing the error message.

Regards & Thanks,

Sourav
Hi,

I have validate a text field with onchange event which throw error message, if not satisfied the condition and set the mouse cursor on the same field using document.focus().

It is working fine in IE, but when used in Firefox, the mouse cursor is moving to the next text field.

Please let me know the possible solution for the above problem.

Regards & Thanks,

Sourav