Jump to content

Problem With onBlur and onClick Event


LOSTBOY

Recommended Posts

I have a text field and a submit

button.The top one has a function connected to the onblur event

when someone leaves the text field.The submit button has a funciton

connected to the onclick event. when I move the mouse from

the text field to the button and press the button.the text input loses focus,

which fires its blur event and it wont fires its click event. here i give an example:Please check out this

<html>
<header>
<script type="text/javascript" src="../javascript/ui/jquery.js"></script>
<script type="text/javascript">
$(function(){
$("#a").blur(function(){
	hi1();
});
$("#Submits").click(function() {
	hi2();
});
});
var id = "";
function hi1(){
id = "1";
alert(id);
return;
}
function hi2(){
id = "2";
alert(id);
}
</script>
</header
<body>
<form name="frm" method="post">
<input type="text" id="a" name="a" >
<input type="button" id="Submits" name="Submits" value="click me"  > 
</form>
</body>
</html>

and give me the suggestion to overcome this problem. ??? :'(

Link to comment
Share on other sites

I have no clue what is going on there, but this does what you described. I just hope you can outfit it with your code...

<html>
<head>
	<script type="text/javascript" src="../javascript/ui/jquery.js"></script>
	<script type="text/javascript">
		<!--
			function Blury(feild)
			{
				alert(feild.value);
			}

			function Submits()
			{
				alert("Submits!");
			}
		//-->
	</script>
</head>

<body>
	<input type="text" name="a" onblur="Blury(this)" />
	<input type="button" name="Submits" value="click me" onclick="Submits()" />
</body>
</html>

 

If this doesn't help you, I will be glued to this topic to see what the deal is with your code........... :-\

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.