473,387 Members | 1,700 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

button in rows

smiley22
[javascript]

i have a table which add buttons in each row,
that can dynamically add rows. how will i able to know
which of the button among the rows are clicked?

gudluck guys !
thanks!
Jan 7 '08 #1
3 1321
gits
5,390 Expert Mod 4TB
hi ...

for example: in case your buttons have an id you may identify them through the event.target.id or in IE event.srcElement.id ... during the handling ... that means, when the click-event occurs that event knows which node has fired it ...

kind regards
Jan 7 '08 #2
hi ...

for example: in case your buttons have an id you may identify them through the event.target.id or in IE event.srcElement.id ... during the handling ... that means, when the click-event occurs that event knows which node has fired it ...

kind regards

[javascript]

for example if i have 5 rows and 5 buttons in each rows how will it be?


thanks :)
[/javascript]
Jan 7 '08 #3
gits
5,390 Expert Mod 4TB
:) example:

[HTML]<html>
<head>
<script type="text/javascript">
function click_handler(e) {
var id = e.target ? e.target.id : e.srcElement.id;
alert(id);
}
</script>
</head>
<body>
<table>
<tr>
<td>
<input type="button" id="b1" value="b1" onclick="click_handler(event);"/>
</td>
</tr>
<tr>
<td>
<input type="button" id="b2" value="b2" onclick="click_handler(event);"/>
</td>
</tr>
</table>
</body>
</html>
[/HTML]
kind regards
Jan 7 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Mariusz | last post by:
Hi, I would like to use shift button to select multiple rows in table but there seems to be problem with it. I have table rows inside the <a> tag so I can drag them and drop like in windows...
2
by: Rebecca | last post by:
I have a dynamically created command button on a .net page that adds 1 row to a sql server table when clicked. The page_load event load rows from that table for the user to view, but for some reason...
0
by: Oz | last post by:
Hi Using VS.NET 2003, Windows XP SP1, We have a page which has been developed using ASP.NET. On it, is a button which when clicked is supposed to add some data to a table. When the button is...
3
by: vcornjamb | last post by:
Hello, I am developing a web form that contains some buttons and a data grid which has as its last column link buttons that will delete the data associated with that row. Everything works fine,...
2
by: Chris | last post by:
I need to add a button column to my datagrid. I need to be able to do this at runtime. I can not have the tag <columns></columns> in my aspx page. This is where I am at Private Function...
0
by: Chris | last post by:
I need to add a button column to my datagrid. I need to be able to do this at runtime. I can not have the tag <columns></columns> in my aspx page. This is where I am at Private Function...
6
by: anirban.anirbanju | last post by:
hi there, i've some serious problem to add rows dynamically in a table. my table contains 5 cell. | check | from_value | to_value | color_text | color_value |...
6
by: sgottenyc | last post by:
Hello, If you could assist me with the following situation, I would be very grateful. I have a table of data retrieved from database displayed on screen. To each row of data, I have added...
1
by: Forumtroll | last post by:
I have a Web User Control that parses an XML file and renders a Form based on the XML. The problem is that I create a button on the bottom of the form that will fire off a subscribeable event, but...
12
by: ive1122 | last post by:
Hi guys, I am looking into create a dynamic survey as posted in Get User Input From Dynamic Controls but with some different environment Below is what i am trying to do: First when the user...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.