...

View Full Version : Can I skip my disabled cells?



dan18088
10-09-2003, 02:10 AM
<td><font size=-1 ><input name="Status<%=count%>" onKeyDown="return KEY( this );" ID="Cell_<%=(row+1)%>" size="3" value="<%=Status%>"</TD>
<td><font size=-1 ><input name="PT_Temp<%=count%>" onKeyDown="return KEY( this );" ID="Cell_<%=(row+2)%>" size="3"></TD>

<%IF InStr( 1, department, "sal", vbTextCompare ) > 0 Then%>
<td><font size=-1 ><input DISABLED name="Regular<%=count%>" onKeyDown="return KEY( this );" ID="Cell_<%=(row+3)%>" size="3" value="0"></TD>
<td><font size=-1 ><input DISABLED name="PTO<%=count%>" onBlur="Total( this );" onKeyDown="return KEY( this );" ID="Cell_<%=(row+4)%>" size="3" value="<%=rstemp("PTO")%>"></TD>
<td><font size=-1 ><input DISABLED name="Other<%=count%>" onBlur size="3" value="<%=rstemp("Other")%>"></TD>
<td><font size=-1 ><input DISABLED name="Other_Type<%=count%>" size="3" value="<%=rstemp("Other_Type")%>"></TD>
<td><font size=-1 ><input DISABLED name="Unpaid_hours<%=count%>" size="4" value="<%=rstemp("Unpaid_Hours")%>"></TD>
<td><font size=-1 ><input DISABLED name="Xtra_hours<%=count%>" size="4" value="<%=rstemp("Xtra_Hours")%>"></TD>
<td><font size=-1 ><input DISABLED name="Reg_hours<%=count%>" size="4" value="<%=rstemp("Reg_Hours")%>"></TD>
<td><font size=-1 ><input DISABLED name="Over_Time<%=count%>" size="3" value="<%=rstemp("Over_Time")%>"></TD>
<td><font size=-1 ><input DISABLED name="Dbl_Time<%=count%>" size="3" value="<%=rstemp("Dbl_Time")%>"></TD>
<td><font size=-1 ><input DISABLED name="Stnd_Oncall<%=count%>" size="3" value="<%=rstemp("Stnd_Oncall")%>"></TD>
<td><font size=-1 ><input DISABLED name="Oncall_Dollars<%=count%>" size="3" value="<%=rstemp("Oncall_Dollars")%>"></TD>
<td><font size=-1 ><input name="Reff_Bonus<%=count%>" onKeyDown="return KEY( this );" ID="Cell_<%=(row+5)%>" size="3" value="<%=rstemp("Reff_Bonus")%>"></TD>
<td><font size=-1 ><input name="Lead_Bonus<%=count%>" onKeyDown="return KEY( this );" ID="Cell_<%=(row+6)%>" size="3" value="<%=rstemp("Lead_Bonus")%>"></TD>
<td><font size=-1 ><input name="Chrg_Dept<%=count%>" onKeyDown="return KEY( this );" ID="Cell_<%=(row+7)%>" size="3" value="<%=rstemp("Chrg_Dept")%>"></TD>
<td><font size=-1 ><input name="Comm<%=count%>" onKeyDown="return KEY( this );" ID="Cell_<%=(row+8)%>" size="2" value="<%=rstemp("Comm")%>"></TD>
<td><font size=-1 ><input name="Gty_Comm<%=count%>" onKeyDown="return KEY( this );" ID="Cell_<%=(row+9)%>" size="3" value="<%=rstemp("Gty_Comm")%>"></TD>
<td><font size=-1 ><input name="Adv_Comm<%=count%>" onKeyDown="return KEY( this );" ID="Cell_<%=(row+10)%>" size="3" value="<%=rstemp("Adv_Comm")%>"></TD>
<td><font size=-1 ><input name="PTO_Dollars<%=count%>" onKeyDown="return KEY( this );" ID="Cell_<%=(row+11)%>" size="3" value="<%=rstemp("PTO_Dollars")%>"></TD>
<%Else%>
<td><font size=-1 ><input name="Regular<%=count%>" onKeyDown="return KEY( this );" ID="Cell_<%=(row+3)%>" size="3" value="80"></TD>
<td><font size=-1 ><input name="PTO<%=count%>" onBlur="Total( this );" onKeyDown="return KEY( this );" ID="Cell_<%=(row+4)%>" size="3" value="<%=rstemp("PTO")%>"></TD>
<td><font size=-1 ><input name="Other<%=count%>" onBlur="Total( this );" onKeyDown="return KEY( this );" ID="Cell_<%=(row+5)%>" size="3" value="<%=rstemp("Other")%>"></TD>
<td><font size=-1 ><input name="Other_Type<%=count%>" onKeyDown="return KEY( this );" ID="Cell_<%=(row+6)%>" size="3" value="<%=rstemp("Other_Type")%>"></TD>
<td><font size=-1 ><input name="Unpaid_hours<%=count%>" onBlur="Total( this );" onKeyDown="return KEY( this );" ID="Cell_<%=(row+7)%>"size="4" value="<%=rstemp("Unpaid_Hours")%>"></TD>
<td><font size=-1 ><input name="Xtra_hours<%=count%>" onBlur="Total( this );" onKeyDown="return KEY( this );" ID="Cell_<%=(row+8)%>"size="4" value="<%=rstemp("Xtra_Hours")%>"></TD>
<td><font size=-1 ><input name="Reg_hours<%=count%>" onKeyDown="return KEY( this );" ID="Cell_<%=(row+9)%>" size="4" value="<%=rstemp("Reg_Hours")%>"></TD>
<td><font size=-1 ><input name="Over_Time<%=count%>" onKeyDown="return KEY( this );" ID="Cell_<%=(row+10)%>" size="3" value="<%=rstemp("Over_Time")%>"></TD>
<td><font size=-1 ><input name="Dbl_Time<%=count%>" onKeyDown="return KEY( this );" ID="Cell_<%=(row+11)%>" size="3" value="<%=rstemp("Dbl_Time")%>"></TD>
<td><font size=-1 ><input name="Stnd_Oncall<%=count%>" onKeyDown="return KEY( this );" ID="Cell_<%=(row+12)%>" size="3" value="<%=rstemp("Stnd_Oncall")%>"></TD>
<td><font size=-1 ><input name="Oncall_Dollars<%=count%>" onKeyDown="return KEY( this );" ID="Cell_<%=(row+13)%>" size="3" value="<%=rstemp("Oncall_Dollars")%>"></TD>
<td><font size=-1 ><input name="Reff_Bonus<%=count%>" onKeyDown="return KEY( this );" ID="Cell_<%=(row+14)%>" size="3" value="<%=rstemp("Reff_Bonus")%>"></TD>
<td><font size=-1 ><input name="Lead_Bonus<%=count%>" onKeyDown="return KEY( this );" ID="Cell_<%=(row+15)%>" size="3" value="<%=rstemp("Lead_Bonus")%>"></TD>
<td><font size=-1 ><input name="Chrg_Dept<%=count%>" onKeyDown="return KEY( this );" ID="Cell_<%=(row+16)%>" size="3" value="<%=rstemp("Chrg_Dept")%>"></TD>
<td><font size=-1 ><input DISABLED name="Comm<%=count%>" onKeyDown="return KEY( this );" ID="Cell_<%=(row+17)%>" size="2" value="<%=rstemp("Comm")%>"></TD>
<td><font size=-1 ><input DISABLED name="Gty_Comm<%=count%>" onKeyDown="return KEY( this );" ID="Cell_<%=(row+18)%>" size="3" value="<%=rstemp("Gty_Comm")%>"></TD>
<td><font size=-1 ><input DISABLED name="Adv_Comm<%=count%>" onKeyDown="return KEY( this );" ID="Cell_<%=(row+19)%>" size="3" value="<%=rstemp("Adv_Comm")%>"></TD>
<td><font size=-1 ><input DISABLED name="PTO_Dollars<%=count%>" onKeyDown="return KEY( this );" ID="Cell_<%=(row+20)%>" size="3" value="<%=rstemp("PTO_Dollars")%>"></TD>

<%End IF%>

</tr>



<%

rstemp.MoveNext

Loop

rstemp.Close
set rstemp=nothing
conntemp.Close
Set conntemp = nothing
%>
</table>

<INPUT Type=Hidden Name="MaxCount" Value="<%=count%>">

<SCRIPT Language="JavaScript">
var MAXROW = <%=count%>;
var MAXCOL = 16;
// the thing that does the work...
function KEY( cell )
{
var kc = event.keyCode;

// not one of the arrow keys? Do nothing
if ( kc < 37 || kc > 40 ) return true;
// for left and right arrows, leave meanings
// alone unless the CTRL key is also pressed
//if ( ( kc == 37 || kc == 39 ) && ( ! event.ctrlKey ) ) return true;
// user pushed one of the arrow buttons...handle it...
//
// first, figure out what cell this is:
var cname = cell.id;
var sTemp;
sTemp = cname.substring( 7, 9 );
var row = parseInt( sTemp, 10 );
sTemp = cname.substring( 9, 11 );
var col = parseInt( sTemp, 10 );

// alert( "row=" + row + ", col=" + col + ": ctrlKey is " + event.ctrlKey);
switch ( kc )
{
case 37:
// left arrow
if ( --col < 1 ) col = MAXCOL;
break;
case 38:
// up arrow
if ( --row < 1 ) row = MAXROW;
break;
case 39:
// right arrow
if ( ++col > MAXCOL ) col = 1;
break;
case 40:
// down arrow
if ( ++row > MAXROW ) row = 1
break;
}
// the 99 is a dummy prefix to make it easy to build
// a cell name from the row and column number:

cname = "Cell_" + ( 990000 + ((100 * row) + col ));

document.getElementById(cname).focus();
return false; // this cancels the normal action of the key
}

joh6nn
10-09-2003, 03:26 AM
um. you can't just throw code at us. you have to give us an actual question, with details.

dan18088
10-09-2003, 03:49 AM
And I already found what I was missing, I forgot to remove the Java Script from the disabled HTML cells. All is well now!

Thanks for replying,
Dan



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum