Thanks MorningZ for that wonderful demo. I think you have nailed my
question here! Thank you so much!

On Jan 5, 12:14 am, MorningZ <morni...@gmail.com> wrote:
> > 1) How do I know if a cell is selected? Is there is is_selected( )
>
> function in jQuery?
>
> There's the ":selected" selector, but it's for valid form fields, not
> table cells...
>
> in your case, $("table td.sel") would give you all selected table
> cells
>
> I have no idea what your PHP looks like, but one way to gather the
> data could be:
>
> http://jsbin.com/areti/edit
>
> but that all depends on what you are looking for (just selected cell
> "values"? do you need position on the grid? something else?)
>
> On Jan 4, 10:11 pm, MT <matt.tha...@gmail.com> 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.
> > ----------------------------------------------------------------------------------------------------------------
> > <html><head><title>Test</title>
> > <script type='text/javascript'
> > src='http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js'></
> > script>
>
> > <script type="text/javascript">
> > $(document).ready(function() {
> >     $("td").toggle(
> >         function () { $(this).addClass("sel"); },
> >         function () { $(this).removeClass("sel"); }
> >      );
>
> > });
>
> > </script>
> >   <style>
> >       .sel { background-color:red; }
> >    </style>
>
> > </head><body>
>
> > <table border="5" cellspace=10>
> > <tr><td>1</td><td>2</td><td>3</td></tr>
> > <tr><td>4</td><td>5</td><td>6</td></tr>
> > <tr><td>7</td><td>8</td><td>9</td></tr>
> > </table>
>
> > <button>Click here to process the selection with a php script</button>
>
> > </body></html>
> > ----------------------------------------------------------------------------------------------------------------

Reply via email to