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
Asked
Active
Viewed 323 times
0
-
1Would you mind showing some of the code involved and what you've tried, please. – Chase Oct 09 '12 at 15:27
-
Currently I dont have code on my machine , but I can tell you scenario.. – Constant Learner Oct 09 '12 at 15:31
-
@Neurofluxation It would help if any of the questions asked had any responses. Guessing those questions have as much detail as this one. :) – epascarello Oct 09 '12 at 15:31
-
@ Neurofluxation , epascarello : i dont understand what you are trying to tell – Constant Learner Oct 09 '12 at 15:32
-
If an answer has helped you, please accept it (click the tick)! – Barrie Reader Oct 09 '12 at 15:35
2 Answers
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