Forums - C# Corner

Forum guidelines
Sinu  Joseph

Sinu Joseph

  • 1.2k
  • 114
  • 33.5k

populate a div on mouseover on textbox inside gridview in jq

Jan 7 2014 7:44 AM
i have a grid view ...
i need to populate a div obove the textbox on mouse over inside the gridview , 
its working properyly on some of the text i need to display the div when the cursor move into the td the div will show with corresponding value on above the text box , and on other td the previous div hide and show new on corresponding div
here is the code :
  function storevalue(obj) {

$('#TestDiv1').hide();
var pos = $(obj).offset();
$('#TestDiv1').show('slow');
$('#TestDiv1').offset({ top: pos.top-30, left: pos.left-30 });
//alert(pos.top); alert(pos.left);


$('#sidebarPage1').show();
var gridview = $(".arrowkeygv");
$.keynavigation(gridview);

obj.style.backgroundColor = "#DFEBF4";
var curmark = parseFloat(obj.value, 10);
var chk = obj.value

if (!isNaN(curmark)) {
document.getElementById('ctl00_ContentPlaceHolder1_HiddenField3').value = curmark;
}
else {
document.getElementById('ctl00_ContentPlaceHolder1_HiddenField3').value = chk;
}


var closest = $(obj).closest("td").index();

var Cutoff = 'ctl00_ContentPlaceHolder1_lvMarkEntry_ctl01_Cutoff' + closest;

var cut = Cutoff;

var Cutoffvalue = document.getElementById(cut).innerHTML;

var arr1 = Cutoffvalue.split("(");

var val1 = arr1[1];

var arr2 = val1.split(")");

var cutof = arr2[0];

var cutoffmark = parseFloat(cutof, 10);

// var lblElement = document.getElementbyId("lblmaxmark");
// lblElement.innerHTML(cutoffmark);
// document.getElementById('lblmaxmark').value=cutoffmark;
$('#ctl00_ContentPlaceHolder1_lblmaxmark').html('Max-Mark is ' + cutoffmark);

}
function pageLoad() {


$('.textbox1').parent('td').hover(
function() {
// var sorted = $(this).find("input[type='text']");
//
// var pos = $(sorted).offset();
$('#TestDiv1').offset({ top: pos.top - 30, left: pos.left-30 });
$('#TestDiv1').show('slow');
},
function() {
$('#TestDiv1').hide();

});

}












































Width="170px">

ErrorMessage="*" InitialValue="0" ValidationGroup="a">



Width="170px">

ErrorMessage="*" InitialValue="0" ValidationGroup="a">

Exam Term

Width="170px">

ErrorMessage="*" InitialValue="0" ValidationGroup="a">

Subject

Width="170px">

ErrorMessage="*" InitialValue="0" ValidationGroup="a">
Text="Need mark entry for this Subject" Visible="False" />

Staff

Width="170px">
























Note:- If Absent Mark 'a'

Visible="false" />

BorderWidth="1px" OnPageIndexChanging="lvMarkEntry_PageIndexChanging" SkinID="IndicatorView"
Width="100%" OnSelectedIndexChanged="lvMarkEntry_SelectedIndexChanged" DataKeyNames="StudentID"
OnRowCreated="lvMarkEntry_RowCreated" BorderStyle="Solid" OnRowDataBound="lvMarkEntry_RowDataBound">










BorderWidth="0px" CellPadding="0" DataKeyField="DivTermSubAcaDetID" Width="100%"
AlternatingItemStyle-ForeColor="AliceBlue" RepeatDirection="Horizontal" HorizontalAlign="Center">


MaxLength="5" Width="40px">
ErrorMessage="*" ValidationExpression="^[.]([0-9]{1,2})|([0-9]+)[.]([0-9]{1,2})$|a|[0-9]+"
ValidationGroup="a">





















Visible="False" />

Enter Password ID="btnApprove" runat="server" Text="Approve" OnClick="btnApprove_Click" />


 





Answers (1)

Unlimited Flat-Free License

SPONSORED BY

File APIs for .NET
Aspose are the market leader of .NET APIs for file business formats – natively work with DOCX, XLSX, PPT, PDF, MSG, MPP, images formats and many more!