nivini
Programmer
- Mar 24, 2004
- 64
Hi all
I have this code, It has rows of textboxex and a button in each row, The button is to delete the row (the record).
And 3 buttons to add differrent kind of rows (records).
Now, no matter what button i press all events happens.
I tryed to add the
window.event.cancellbubble=true
to all buttons but it didnt help.
please take a look at the code, and find out what i cant find out
Thank you all expert in advance
here it is:
I have this code, It has rows of textboxex and a button in each row, The button is to delete the row (the record).
And 3 buttons to add differrent kind of rows (records).
Now, no matter what button i press all events happens.
I tryed to add the
window.event.cancellbubble=true
to all buttons but it didnt help.
please take a look at the code, and find out what i cant find out
Thank you all expert in advance
here it is:
Code:
<%@ Language=VBScript %>
<%
conStr = "DRIVER=Microsoft Access Driver (*.mdb);DBQ="
DSNName=conStr & server.MapPath("/db/news.mdb")
strSql="select * FROM tblnews"
set rs=server.CreateObject("adodb.recordset")
set con =server.CreateObject ("adodb.connection")
con.Open DSNName
function addArticle()
strSql="INSERT INTO tblNews (code,articleHeader,articlePath) VALUES(3,'tryTOAddArticle','2.doc')"
con.Execute strsql
end function
function AddProtocol()
end function
function AddEvent()
end function
function DEL(num)
strSql="DELETE FROM tblNews WHERE id="&num
con.Execute strSql
end function
%>
<html>
<body>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1255" dir="rtl">
<title></title>
</HEAD>
<div align="center">
<b><font size="5">MANAGMENT</font></b><br>
<div align=center>
<form method="Post" id=form1 name=form1 onclick=window.event.cancelbubble=true >
<%
rs.Open strSql,con,3,3
dim i
i=0
if not rs.EOF then
while not rs.EOF
i=i+1
Response.Write "<input type='text' value='"&rs("articleHeader")&"' name='Header"&i&"' id='Header"&i&"' >"
Response.Write "<input type='text' value='"&rs("articlePath")&"' name='Path"&i&"' id='Path"&i&"' >"
response.Write "<input type='button' value='ERASE' name='"&rs("id")&" id='"&rs("id")&"' onclick='"&DEL(rs("id"))&"; window.event.cancelbubble=true;' language='javascript'>"
rs.MoveNext
Response.Write "<br>"
Response.Write "<br>"
wend
end if
Response.Write "<input type='button' value='ADD PROTOKOL' name='Protocol' id='Protocol' onclick='"&AddProtocol()&" ;window.event.cancelbubble=true;' language='javascript'>"
Response.Write "<input type='button' value='ADD EVENT' name='event' id='event' onclick='"&addEvent()&" ;window.event.cancelbubble=true;' language='javascript'>"
Response.Write "<input type='button' value='ADD ARTICLE' name='article' id='article' onclick='"&addArticle()&";window.event.cancelbubble=true;' language='javascript'>"
%>
</form>
</div>
</body>
</html>