Chintan Dave

Chintan Dave

  • 1.8k
  • 67
  • 8k

onblur function gives infinite alert message

Sep 26 2018 4:29 AM
Attached is the simple html file comprising two textboxes having similar onblur function mentioned in head section of page.
Scenario 1 :
If I tab out from first textbox it gives me alert message for infinite times and page gets stuck. This scenario happens only when I have multiple textbox on page.
Scenario 2:
If I remove one textbox and comment out another one then scenario 1 is not produced.
Why in scenario 1 page gets stuck because of infinite alert messages?
HTML Code for more convenience (if anybody is reluctant to extract the zip file):
<script type = "text/javascript">
function testmethod()
alert ("hi");
return false;
<input type="text" id = "txtSample" onblur="javascript:testmethod();"> </input>
<input type="text" id = "txtSample1" onblur="javascript:testmethod();"> </input>


Answers (2)