Fetching Values from a dynamical created table 
Author Message
 Fetching Values from a dynamical created table

Hi i've created a table by doing loops in ASP. In every Row i need to have a
delete button with an onclick event assigned to it, that
fetches a value from the same row, how can i solve this ? The table is
created like this:

  <%While Not project.EOF%>
   <tr bgcolor=#c0c0c0 bordercolorLight=#000000 bordercolorDark=#ffffff>

    <td align=left><%=project("firm")%></td>
    <td align=left><%=project("Department")%></td>
    <td align=left><%=project("project")%></td>
    <td align=left><%=project("description")%></td>
    <td align=left><%=project("unitprice")%></td>
    <td align=left><A
HREF="/intranet/internalroutines/project/addproject.asp?Delete=project&id=<%
=project("projectid")%>"> Delete</A></td>
   </tr>
  <%project.movenext%>
  <%wend%>

What i want, is that when the user clicks the Delete link, a msgbox should
appear asking if user really wants to delete the
<%=project("project")%>. If user answers yes, then i have to strip that
project name by doing a mid (project,1,6) and add that value to the
querystring.

I'm using VBScripts on the client side since all users are running IE 4.01

*Darn i'm really stuck on this one* ;)

Kai Thorsrud

Consulting Group AS



Mon, 03 Sep 2001 03:00:00 GMT  
 Fetching Values from a dynamical created table
Hello,

Your event handler can do something like this:

Sub HandleEvent()

Dim curRow
Dim curCol

curRow = event.srcElement.parentElement.rowIndex
curCol = event.srcElement.cellIndex

End Sub

This allows you to get at any element in your table based on the row and
cell indexes through the rows and cols collections.

Ted White
Intelesoft
http://www.intelesoft.com

Quote:

>Hi i've created a table by doing loops in ASP. In every Row i need to have
a
>delete button with an onclick event assigned to it, that
>fetches a value from the same row, how can i solve this ? The table is
>created like this:

>  <%While Not project.EOF%>
>   <tr bgcolor=#c0c0c0 bordercolorLight=#000000 bordercolorDark=#ffffff>

>    <td align=left><%=project("firm")%></td>
>    <td align=left><%=project("Department")%></td>
>    <td align=left><%=project("project")%></td>
>    <td align=left><%=project("description")%></td>
>    <td align=left><%=project("unitprice")%></td>
>    <td align=left><A
>HREF="/intranet/internalroutines/project/addproject.asp?Delete=project&id=<
%
>=project("projectid")%>"> Delete</A></td>
>   </tr>
>  <%project.movenext%>
>  <%wend%>

>What i want, is that when the user clicks the Delete link, a msgbox should
>appear asking if user really wants to delete the
><%=project("project")%>. If user answers yes, then i have to strip that
>project name by doing a mid (project,1,6) and add that value to the
>querystring.

>I'm using VBScripts on the client side since all users are running IE 4.01

>*Darn i'm really stuck on this one* ;)

>Kai Thorsrud

>Consulting Group AS



Mon, 03 Sep 2001 03:00:00 GMT  
 Fetching Values from a dynamical created table
Thanks a lot ;)

You saved my day !!!

Quote:

>Hello,

>Your event handler can do something like this:

>Sub HandleEvent()

>Dim curRow
>Dim curCol

>curRow = event.srcElement.parentElement.rowIndex
>curCol = event.srcElement.cellIndex

>End Sub

>This allows you to get at any element in your table based on the row and
>cell indexes through the rows and cols collections.

>Ted White
>Intelesoft
>http://www.intelesoft.com



Mon, 10 Sep 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Fetching Values from a dynamical created table

2. Creating links between tables dynamical - how?

3. How to fetch control's value?

4. decimal values in ODBC fetch

5. pblm in fetching value of a auto increment column

6. pblm in fetching value of a auto increment column

7. how to fetch value from html file ????

8. The range value when creating Table

9. Creating jet 4.0 table columns that can accept null values

10. How to create comma seperated value text file from an access table

11. databind TDC table - add datafld value to variable string in table

12. Stored Procedure - Table fetch

 

 
Powered by phpBB® Forum Software