14
rated 0 times
[
16]
[
2]
/ answers: 1 / hits: 28878
/ 12 Years ago, thu, june 14, 2012, 12:00:00
see fiddle
if patient has time slot alloted already then make color yellow using jquery(client side).
in my fiddle if i allot time slot first time then color is green and at the same time when allot
next time slot then previous time slot is grey. i have to make it yellow.
for that i have to find span tag in table and check wheather contains text or not
if contains text then make it yellow.But i m new in jquery.i search lot but not getting.
how can i do that.
//This is button click code
$(#<%=btnSelect.ClientID%>).click(function () {
var cells = $('#tableAppointment tbody tr td:nth-child(3)');
var i = 0;
var topcell = false;
cells.each(function ()
{
var $cell = $(this);
if ($cell.hasClass('csstdhighlight'))
{
if (i == 0)
{
$cell.find('span').text(jQuery('#<%=txtPatientName.ClientID%>').val());
topcell = $cell;
}
else
{
$cell.remove();
}
i++;
}
});
if (topcell && i > 1) topcell.attr('rowspan', i);
$(#tableAppointment tr).each(function ()
{
$('td', this).each(function ()
{
var value = $(this).find(span).val();
if (!value)//i m chking like this
{
}
else
{ //make it yellow
}
})
})
return false;
});
});
More From » jquery