MozillaZine

Onblur and Onclick events executing simulteneously

Discussion of bugs in Mozilla Firefox
imranbagwan.cs
 
Posts: 3
Joined: January 3rd, 2018, 4:17 am

Post Posted January 3rd, 2018, 5:59 am

I have hyperlink in a webpage, that calls a javascript function.

i have another .js file that contains validation methods,

when i provide a invalid input as per the criteria, it works for onblur,

when i provide a invalid input and hit hyperlink directly, it is not stopping for onblur to complete.

it goes further and executes.

"It is working in non ESR Mozilla Browser but now in Mozilla ESR".

And, it works for other browsers as expected.

therube

User avatar
 
Posts: 19186
Joined: March 10th, 2004, 9:59 pm
Location: Maryland USA

Post Posted January 3rd, 2018, 11:55 am

> working in non ESR

I take it you mean FF 57 & up?

> Mozilla ESR

I take it to mean FF 52?

What does the code look like?
Anything related noted in Error Console?
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball CopyURL+ FetchTextURL FlashGot NoScript

imranbagwan.cs
 
Posts: 3
Joined: January 3rd, 2018, 4:17 am

Post Posted January 4th, 2018, 5:38 am

<html>
<script type="text/javascript">
function save(){
alert("in Save Method..")
window.location.href = "secondPage.html";
}

function isValidFraction(inputObj) {
if(!inputObj.value.match(/^\d+(\.\d+)?$/)){
inputObj.value="";
//inputObj.focus();
alert("Inavlid Float Number");
return false;
}
return true;
}

function isValidInteger(inputObj) {
if(!inputObj.value.match(/^\d+(\.\d+)?$/)){
inputObj.value="";
//inputObj.focus();
alert("Inavlid Integer Number");
return false;
}
return true;
}

</script>


<a href="javascript:save()"> Save </a> <br><br>
<input type="text" id="float_input" placeholder="Float Value" onblur="if(isValidFraction(this)){alert('valid.......');}">
<input type="text" id="int_input" placeholder="Int Value" onblur="if(isValidInteger(this)){alert('valid.......');}">
</html>

Return to Firefox Bugs


Who is online

Users browsing this forum: No registered users and 1 guest