how about something simple but eludes me ->onselect ->post

T

Terry

Hello:
I have a bound datagrid and I want to do something simple but I canot figure
it out:
When I click on a row, I want to capture a cell value in the row (simple)
but I also want to post the form, ie, submit the form .... apparently the
datagrid does not support postings like the button and checkbox objects...
Thanks for your help or direction
Terry
 
E

Eliyahu Goldin

Terry,

Use ItemDataBound event to loop through every datarow cell and set
Attributes["onclick"]="myHandler(this)";

myHandler is a javascript function that should accept reference to <td> as
parameter. That's how you get the value. In the same function you can do
myForm.submit();

Eliyahu
 
S

Support

Thanks but I tried the MyForm.submit() but myForm is a runat=server and is
not visible (apparently) to JavaScript because I can get a JavaScript
reaction like an alert on click but no submit...

Eliyahu Goldin said:
Terry,

Use ItemDataBound event to loop through every datarow cell and set
Attributes["onclick"]="myHandler(this)";

myHandler is a javascript function that should accept reference to <td> as
parameter. That's how you get the value. In the same function you can do
myForm.submit();

Eliyahu

Terry said:
Hello:
I have a bound datagrid and I want to do something simple but I canot figure
it out:
When I click on a row, I want to capture a cell value in the row (simple)
but I also want to post the form, ie, submit the form .... apparently the
datagrid does not support postings like the button and checkbox objects...
Thanks for your help or direction
Terry
 
E

Eliyahu Goldin

runat=server doesn't make any difference on client side. Javascript should
see the form well. Note that javascript is case-sensitive. You can also try
document.getElementById().

Eliyahu

Support said:
Thanks but I tried the MyForm.submit() but myForm is a runat=server and is
not visible (apparently) to JavaScript because I can get a JavaScript
reaction like an alert on click but no submit...

Eliyahu Goldin said:
Terry,

Use ItemDataBound event to loop through every datarow cell and set
Attributes["onclick"]="myHandler(this)";

myHandler is a javascript function that should accept reference to <td> as
parameter. That's how you get the value. In the same function you can do
myForm.submit();

Eliyahu

Terry said:
Hello:
I have a bound datagrid and I want to do something simple but I canot figure
it out:
When I click on a row, I want to capture a cell value in the row (simple)
but I also want to post the form, ie, submit the form .... apparently the
datagrid does not support postings like the button and checkbox objects...
Thanks for your help or direction
Terry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top