1

We have this checkbox on gridview:

<ItemTemplate>
 <asp:CheckBox ID="chkb" runat="server" onclick = "Check_this(this)" />
</ItemTemplate> 

Our users can click to check one box or they can click to check many boxes.

We would like to add another column:

<asp:BoundField ItemStyle-Width = "150px" DataField = "curDate" SortExpression="curDate" HeaderText = "Date Accepted" />

This way, anytime a user checks one or more checkboxes, the date the box was checked is automatically recorded and displayed.

Can you please suggest how I can go about handling this?

Thank you very much.

Leandro Bardelli
  • 10,561
  • 15
  • 79
  • 116
Chidi Okeh
  • 1,537
  • 8
  • 28
  • 50

1 Answers1

0

I'm not versed in asp, so I can't give you the exact code to solve your problem. I can, however, explain how to do it with JavaScript.

In your Check_this() function add a line that sets wherever you want to output the date to, to the current date. I'm not sure how you fetch locations in asp, but with plain HTML and JS it'd be document.getElementById("curDate").innerHTML = new Date()

Rhyono
  • 2,420
  • 1
  • 25
  • 41