[jQuery] Re: How to retrieve the selected cells

2010-01-05 Thread MT
Thanks Kanpan, with your code I know where to make the ajax call.
Combining with MorningZ's solution and your suggestion I am very
certain that I will be able to get my task done!

Thank you guys for your help!

On Jan 4, 11:55 pm, Kanpan  wrote:
> What you know is that you're assigning classes to the selected cells.
> Your best bet is to detect an onclick event on your button and then
> loop through the td elements with the class "sel" and get each of
> their value. Then take those values and submit them via ajax to your
> php script.
>
> Something like...
>
> $("#MyBtn").click(function() {
>  var values;
>  $(".sel").each(function() {
>   values += $(this).html()+",";
>  }):
>  $.ajax({
>   ...
>  });
>
> });
>
> On Jan 4, 10:11 pm, MT  wrote:
>
> > Hi all,
>
> > I am new to jQuery and I would like to process a matrix operation
> > using PHP.
> > The front-end code is done bellow, its a 3x3 table. the user could
> > select/deselect individual cells of the table and click the button
> > that calls a PHP script that will run some function.
>
> > 1) How do I know if a cell is selected? Is there is is_selected( )
> > function in jQuery?
> > 2) Would it be possible to send a 3x3 array to my PHP script?
>
> > Please provide me with any info on this. Thanks!
>
> > MT
>
> > My current test code.
> > --- 
> > -
> > Test
> >  > src='http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js'> > script>
>
> >