Click here to Skip to main content
16,006,013 members
Home / Discussions / Web Development
   

Web Development

 
GeneralRe: Javascript & IE Pin
Anonymous9-Sep-05 4:53
Anonymous9-Sep-05 4:53 
AnswerRe: Javascript & IE Pin
Shog99-Sep-05 15:14
sitebuilderShog99-Sep-05 15:14 
GeneralRe: Javascript & IE Pin
Anonymous9-Sep-05 18:11
Anonymous9-Sep-05 18:11 
GeneralRe: Javascript & IE Pin
enjoycrack9-Sep-05 18:58
enjoycrack9-Sep-05 18:58 
Questionhtml ->JSTL Pin
ginognaus8-Sep-05 15:14
ginognaus8-Sep-05 15:14 
QuestionFrames etc. Pin
Jeeves1238-Sep-05 14:52
Jeeves1238-Sep-05 14:52 
AnswerRe: Frames etc. Pin
Guffa8-Sep-05 15:11
Guffa8-Sep-05 15:11 
Questionrecordset not displaying Pin
Shrex8-Sep-05 11:37
Shrex8-Sep-05 11:37 
hi guys, i have a jscript piece of code that is not displaying the records together with the radio buttons, The sql statement works fine (i checked it in Access and it works) but it just won't display, can someone check where i went wrong please. There are no errors, it just displays the 'update" button.

here it is

<html>
<head>
<title>Attendance Records</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
body {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 10pt;
}
-->
</style>
</head>

<body>
<%@ LANGUAGE="JAVASCRIPT" %>
<%
var conn;
var rs;
var strSQL;
var fld;
conn = new ActiveXObject("ADODB.Connection");
conn.Open("Provider=Microsoft.Jet.OLEDB.4.0; DATA SOURCE =  " + Server.MapPath("db1.mdb"));
if(Request.Form("update") == "update"){
 for (var fld in Request.Form)
 {
  if(Left(fld,7) == "status_"){
   student_id = CLng(Mid(fld,8));
   attendance = Request.Form(fld);
   strSQL = "Update tblattendatt_status = '" + attendance + "' WHERE studentID = " + student_id + " && att_date = Date()";
   conn.Execute (strSQL);
   if(recsupdated == 0){
    conn.Execute = "Insert INTO tblattend(studentID,att_status,att_date) VALUES(" + student_id + ",'" + attendance + "', #"  + Month(Date()) + "/" + Day(Date()) + "/" + Year(Date()) + "#)";
   }
  }
 next;
}
 
rs = conn.Execute("Select tblstudent.studentID, tblstudent.Name, tblattend.att_status From tblstudent LEFT JOIN tblattend ON (tblstudent.studentID = tblattend.studentID && tblattend.att_date = Date()) ORDER by tblstudent.Name");

function currentstatus(statval){
 if(rs("att_status") == statval){
  currentstatus = " checked";
 }else{
  currentstatus = "";
 }
 }
%>;
<div align="center"><font size="3">Attendance records for today</font></div>;
<form name="form1" method="post" action="">;
  <table width="50%"  border="0" align="center" cellpadding="4" cellspacing="0">;
    <tr bgcolor="#CCCCCC">;
      <td width="58%">Student</td>;
      <td width="14%">Present</td>;
      <td width="14%">Absent</td>;
      <td width="14%">Late</td>;
    </tr>;
 <%
 while (!rs.eof) {
     Response.Write("<tr>");
       Response.Write("<td>" + rs("Name") + "</td>");
       Response.Write("<td><input type=radio name='status_" + rs("studentID") + "' value='P" + currentstatus("P") + "'></td>");
	   Response.Write("<td><input type=radio name='status_" + rs("studentID") + "' value='A" + currentstatus("A") + "'></td>");
	   Response.Write("<td><input type=radio name='status_" + rs("studentID") + "' value='L" + currentstatus("L") + "'></td>");
     Response.Write("</tr>");
  rs.movenext();
 Wend();
 }
 rs.Close();
 
conn = null;
}
 %>
 	<tr bgcolor="#CCCCCC"><td></td><td></td><td></td><td><input type="submit" name="update" value="update"></td></tr>
  </table>
</form>
</body>
</html>

QuestionRegular Expression Problem. Pin
Anonymous8-Sep-05 6:34
Anonymous8-Sep-05 6:34 
AnswerRe: Regular Expression Problem. Pin
Guffa8-Sep-05 12:22
Guffa8-Sep-05 12:22 
Questionjava script Pin
wpcolleen8-Sep-05 4:35
wpcolleen8-Sep-05 4:35 
AnswerRe: java script Pin
Guffa8-Sep-05 11:21
Guffa8-Sep-05 11:21 
QuestionBrowse toolbar Pin
wpcolleen8-Sep-05 1:53
wpcolleen8-Sep-05 1:53 
AnswerRe: Browse toolbar Pin
enjoycrack8-Sep-05 2:14
enjoycrack8-Sep-05 2:14 
GeneralRe: Browse toolbar Pin
wpcolleen8-Sep-05 3:11
wpcolleen8-Sep-05 3:11 
GeneralRe: Browse toolbar Pin
Shog99-Sep-05 15:16
sitebuilderShog99-Sep-05 15:16 
QuestionShow confirm when close a webpage Pin
LongNguyen7-Sep-05 23:25
LongNguyen7-Sep-05 23:25 
AnswerRe: Show confirm when close a webpage Pin
minhpc_bk8-Sep-05 0:26
minhpc_bk8-Sep-05 0:26 
QuestionRe: Show confirm when close a webpage Pin
LongNguyen8-Sep-05 16:48
LongNguyen8-Sep-05 16:48 
AnswerRe: Show confirm when close a webpage Pin
minhpc_bk8-Sep-05 17:00
minhpc_bk8-Sep-05 17:00 
QuestionJavascript Pin
hung_ngole7-Sep-05 21:23
hung_ngole7-Sep-05 21:23 
QuestionWhat to do ? Pin
AlisiaWillimans7-Sep-05 20:38
AlisiaWillimans7-Sep-05 20:38 
AnswerRe: What to do ? Pin
Christian Graus8-Sep-05 13:56
protectorChristian Graus8-Sep-05 13:56 
Questionscript attacks on a username Pin
phamus7-Sep-05 5:52
phamus7-Sep-05 5:52 
QuestionRe: script attacks on a username Pin
Guffa8-Sep-05 3:31
Guffa8-Sep-05 3:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.