Hi,
Every Html controls should have id field. So, first make urself to
use id for any field, even it is a simple text box, Okay. This will make
u code well & efficient. If, u don''t understand, no pbm. Just keep
it.
Later, u will understood. Then,
For ur problem,
---> Assign a id for ur form.
<form id=''me'' name=''MyForm''
action=''something''>
---> Have a link like this,
<a
href=''javascript:checkAll("me")''>Check All</a>
<a
href=''javascript:unCheckAll("me")''>UnCheck
All</a>
---> For this, u need foll. javascript code,
<script language = ''javascript''>
function checkAll(t){
var el = document.getElementById(t);
for (var i = 0; i < el.elements.length; i++) {
el.elements[i].checked = true;
}
}
function unCheckAll(t){
var el = document.getElementById(t);
for (var i = 0; i < el.elements.length; i++) {
el.elements[i].checked = false;
}
}
</script>
---> Come on. What happens? Bye. Thank U!!!.
De Railed wrote:> Hi,
>
> I have a table with a paginator and each row displays its own
> checkbox.
> I want to be able to offer actions like
> select_all/deselect_all/select_partial.
> The problem how does on record user actions so that the form is
> correctly posted once the user hits submit ?
>
> Can anyone point me out to an elegant solution to this common problem
> ?
> Code or article would be great !!
>
> Many Thanks...
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---