I have this TextBox
in which when I update the page you can see div
as windows with a "MouseOver" event, what I try to do is the following:
-
When I refresh "N" times the page that in the first instance these
div
do not go only when I pass the mouse through the text box -
When entering text in the text boxes, the
div
is disabled and the label is marked with an asterisk "*" in red.
Here I leave the source code:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>DEMO</title>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<style type="text/css">
.description {
z-index: auto;
position: absolute;
left: 193px;
/*margin-top: 180px;*/
top: 0px;
padding: 3px 6px;
border: 1px solid #caac09;
background: #fff7b4;
color: #4b3904;
font-family: Segoe UI Light;
font-size: 10pt;
text-decoration: none;
font-weight: normal;
}
.DesApeMa {
z-index: auto;
position: absolute;
left: 424px;
top: 0px;
padding: 3px 6px;
border: 1px solid #caac09;
background: #fff7b4;
color: #4b3904;
font-family: Segoe UI Light;
font-size: 10pt;
text-decoration: none;
font-weight: normal;
}
.DesNom {
z-index: auto;
position: absolute;
left: 702px;
top: 0px;
padding: 3px 6px;
border: 1px solid #caac09;
background: #fff7b4;
color: #4b3904;
font-family: Segoe UI Light;
font-size: 10pt;
text-decoration: none;
font-weight: normal;
}
.LabelApellido {
color: red;
font-size: 13pt;
margin-top: 3px;
margin-left: 221px;
margin-top: -20px;
position: absolute;
}
.LabelApellidoMa {
color: red;
font-size: 13pt;
margin-top: 0px;
margin-left: -12px;
position: absolute;
}
.LabelNombre {
color: red;
font-size: 13pt;
margin-top: -5px;
margin-top: -20px;
margin-left: 361px;
position: absolute;
}
.PopUpApePA, PopUpApeMA, PopUpNOM {
}
</style>
</head>
<body>
<form runat="server">
<div id="main-wrapper">
<table id="TblDemo">
<tr>
<td style="border: 0px solid" colspan="7">
<table id="tblDatosPersonales" class="FontText">
<tr>
<td class="TextAlign" colspan="1" rowspan="2" width="31px">01.</td>
<td colspan="1" width="230px">
<div class="PopUpApePA">
<asp:TextBox ID="txtapepaterno" runat="server" Width="230px" CssClass="TextBoxBorder"></asp:TextBox>
<div class="description">No puede estar en blanco</div>
<asp:Label ID="lblapepaterno" runat="server" Text="*" CssClass="LabelApellido"></asp:Label>
</div>
</td>
<td colspan="2" width="281px">
<div class="PopUpApeMA">
<asp:TextBox ID="txtapematerno" runat="server" Width="274px" CssClass="TextBoxBorder"></asp:TextBox>
<div class="DesApeMa">No puede estar en blanco</div>
<asp:Label ID="lblapematerno" runat="server" Text="*" CssClass="LabelApellidoMa"></asp:Label>
</div>
</td>
<td colspan="3" width="450px">
<div class="PopUpNOM">
<asp:TextBox ID="txtnombre" runat="server" Width="468px" CssClass="TextBoxBorder"></asp:TextBox>
<div class="DesNom">No puede estar en blanco</div>
<asp:Label ID="lblnombre" runat="server" Text="*" CssClass="LabelNombre"></asp:Label>
</div>
</td>
</tr>
<tr class="TextAlign">
<td colspan="1">Apellido Paterno</td>
<td colspan="2">Apellido Materno</td>
<td colspan="3">Nombres</td>
</tr>
</table>
</div>
</form>
</body>
<script>
$(".PopUpApePA").mouseover(function () {
$(this).children(".description").show();
}).mouseout(function () {
$(this).children(".description").hide();
});
$(".PopUpApeMA").mouseover(function () {
$(this).children(".DesApeMa").show();
}).mouseout(function () {
$(this).children(".DesApeMa").hide();
});
$(".PopUpNOM").mouseover(function () {
$(this).children(".DesNom").show();
}).mouseout(function () {
$(this).children(".DesNom").hide();
});
</script>