0

I have form in which I have several controls. My concern is that when I filling values in Panel1 , & click on any other control or space outside panel1 .How can I get alert message. I am working in asp.net

Constant Learner
  • 525
  • 4
  • 13
  • 30

2 Answers2

2

Add a click event to the body. Check the event's target or srcElement to see where the click occured. See if the cilck occurs on an element that is in the panel.

epascarello
  • 204,599
  • 20
  • 195
  • 236
0

Use focusin and focusout of Jquery.

<div style="border: 1px solid black;padding:10px;">
   First name: <input type="text"><br>
  Last name: <input type="text">
</div>`
<script>
$(document).ready(function(){
$("div").focusin(function(){
    $(this).css("background-color", "#FFFFCC");
});
$("div").focusout(function(){
    $(this).css("background-color", "#FFFFFF");
});
});

DDK
  • 71
  • 1
  • 8