|
Put target="_top" in the form.
---
b { font-weight: normal; }
|
|
|
|
|
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>
|
|
|
|
|
Hi all, I have a query regarding javascript regular expression.
I have one string which has "(double quote) and \(slash) characters.
Now, how I can replace these ( " with \" and \ with \\)using regular expressions at one iteration otherwise it will be recursive.
I mean we have to check every character and replace it. Can I use replace() method for this?
Thanks,
Jay
|
|
|
|
|
You don't have to use regular expressions for that.
oneString = oneString.replace('\\', '\\\\').replace('"', '\\"');
---
b { font-weight: normal; }
|
|
|
|
|
How do I get the maxlength attribute of an input field in a java-script
eg
document.getElementById("keypad1_txtResult").value
gives me the value
but document.getElementById("keypad1_txtResult").maxlength
gives me undefined
clueless
|
|
|
|
|
maxLength
Javascript is case sensetive.
---
b { font-weight: normal; }
|
|
|
|
|
Does any know how to not display the browser toolbar in a web page?
Clueless
|
|
|
|
|
hi there,
this can be done with js: window.open with feature "toolbar=no"
the link below might give u more infor on this
http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/methods/open_0.asp
<< >>
-- modified at 8:16 Thursday 8th September, 2005
|
|
|
|
|
Thanks, but I still don't follow. I want the first page displayed not to display the toolbar.
|
|
|
|
|
The appearance of the first page is the user's decision. They may want the toolbar. You can have some control over auxilary windows (as the previous poster mentioned), but the main window is the user's.
|
|
|
|
|
I am designing a webpage and I want to write some script(javascript) to show a confirm message "Do you want to exit?" when I close this page (or switch to another page). If I click "Ok" the page will close (or switch to another page) and if I click "cancel" the page will not close. What must I do?.
|
|
|
|
|
|
Thank for your help . But it's not what I want. Look at my code below:
function closeIt()
{
event.returnValue = "Do you want to exit?";
}
Click here to navigate to
www.microsoft.com
When I click to navigate to another page, I want to show a confirm "Do you want to exit?". If I click Ok, I can navigate to another page. If I click cancel, nothing happen. That's what I want. But when I close the page, a confirm "Are you sure you want to navigate away from this page? Do you want to exit? Press Ok to continue, or Cancel to stay on the current page." appear, that's too long and complicated. I just want to show a confirm "Do you want to exit?".
Undead142
-- modified at 22:49 Thursday 8th September, 2005
|
|
|
|
|
Basically, when you navigate to another page or close the browser the onbeforeunload , and onunload events get fired. You can raise the confirm message with the onunload event, but it's too late to cancel the event. So the only thing IMO you can use is the onbeforeunload . Thought it not 100% what you want, it seems quite close to that.
|
|
|
|
|
I want to call the Escape Key immediately after the page unload. But I don't know how to call the Escape Key ? Please help me !
Hung
|
|
|
|
|
I am in a slight dilemma at the moment i'm not sure whether to go down the a+/mcse route or whether to take the CIW courses instead. I have been doing some research to try and find out about them I would appreciate any opinions you have on the CIW and MCDBA.
I have quite good html skills and know some Javascript when it comes to web design. Wouldn’t mind taking things a step further by taking the CIW course but I need to know if employers recognize it and does passing the CIW give you a reasonable chance of getting a job in web design or anything related to the Internet?
Alisia
|
|
|
|
|
What is CIW ?
AlisiaWillimans wrote:
I have quite good html skills and know some Javascript when it comes to web design.
Sorry, but these were marketable in about 1998.
AlisiaWillimans wrote:
Wouldn’t mind taking things a step further by taking the CIW course but I need to know if employers recognize it and does passing the CIW give you a reasonable chance of getting a job in web design or anything related to the Internet?
To write web sites nowadays, you should learn J2EE or ASP.NET. ASP.NET is definately nicer and easier. Then you'd have marketable skills, for sure. I have no idea what employers regard as highly, except that I am sure they will regard it highly if you show up having taught yourself, and show yourself to be knowledgable. That's how I got my job, I have no qualifications at all.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I am wondering what is the best way to validate username text on a page. HTMLEncoding and URLEncoding are what I have found to validate the username. Is there a better way to check for script attacks then this or am I on the right track?
|
|
|
|
|
Why not continue on your previous thread about script attacks?
---
b { font-weight: normal; }
|
|
|
|
|
Hi,
I have been using Visual C++ since v1.5, and now have Visual Studio 2003 and Beta2 of 2005.
Also, I have a broad use of Java,,,so no problem in using the tools.
Now is my first look at programmatic Web navigation.
What I want to know is, can I write a Client (preferably in C/C++ with/without MFC, or Java) that can navigate Web pages, and enter things like a UserID/Password on a page, then navigate to the required page after the login is OK, navigate on from that (like clicking an option on the page) to a dynamically created page, and retrieve data from it.
If there are any examples out there to get me started that would be a bonus too.
Many Thanks,
Bryan.
|
|
|
|
|
Yes...
Internet Explorer is basically a shell around the IWebBrowser2 COM object.
There are many articles on here which explain how use that object.
Using MFC you can quickly see what I mean by creating a project using appwizard and checking that you want to use views, but instead of CView you use CHtmlView
Search Codeproject for CHtmlView for lots of exmaples as to what is possible using the class (which is basically a MFC wrapper around the COM IWebBrowser2 .
Not sure if any article covers exactly what your trying to do - i'm not sure what your trying to do...too lazy to re-read...but if you search CHtmlView here on CP you should be pleasantly surprised.
Cheers
It's frustrating being a genius and living the life of a moron!!!
|
|
|
|
|
Well, that has given me something to look at - and a few new ideas...
Thanks,
Bryan.
|
|
|
|
|
Is there a way to specify a default error page in the web.config file
thanks,
Tom
|
|
|
|
|
set the customErrors node to mode="On" and defaultRedirect="your error page".
I can imagine the sinking feeling one would have after ordering my book,
only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon
|
|
|
|
|