Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #28422

Re: Retrieve a select from a table cell

From Joao Rodrigues <groups_jr-1@yahoo.com.br>
Newsgroups comp.lang.javascript
Subject Re: Retrieve a select from a table cell
Date 2015-07-14 17:28 -0300
Organization Aioe.org NNTP Server
Message-ID <mo3rcn$2h2$1@speranza.aioe.org> (permalink)
References <mo2utl$9s5$1@dont-email.me> <mo3oq2$qo5$1@speranza.aioe.org> <mo3pud$u2u$1@speranza.aioe.org> <3951517.CJbgAzKFgc@PointedEars.de>

Show all headers | View raw


Em 14/07/2015 17:07, Thomas 'PointedEars' Lahn escreveu:
> Joao Rodrigues wrote:
> 
>>   function cellClick(e) {
>>     var fc = e.target;
>>     if (/input|select/i.test(fc.tagName)) {
>>       window.alert(fc.type + " - " + fc.nodeName
>>                    + " - " + fc.value + " - "
>>                    + fc.nodeType);
>>     }
>>   }
> 
> Not only as insufficient as your first approach (see my other follow-up), 

The OP's putclick() function didn't seem to take care of the select's
options. She just added new selects with the DOMcreasel() function.

> but even more inefficient and error-prone.  If you are using a regular 
> expression, you need to anchor it to prevent false positives, at least 
> /^(input|select)$/i.

More efficient, but unnecessary for the test case. Why do you always
repeat it?

> But you can do without such an expensive RegExp here.

Expensive for modern JavaScript Engines? Nah.

> Finally, the “input” appears to be coming from your imagination only; read 
> again.
> 

You should read again as you have forgotten the HTML table in the OP's code:

| <TD><INPUT type='checkbox' name='chk'/></TD>
| <TD><INPUT type='text' name='txt'/></TD>

-- 
Joao Rodrigues

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Retrieve a select from a table cell "danca (Daniele Campagna)" <cyberdanny@tiscalinet.it> - 2015-07-14 14:24 +0200
  Re: Retrieve a select from a table cell "Christoph M. Becker" <cmbecker69@arcor.de> - 2015-07-14 14:45 +0200
    Re: Retrieve a select from a table cell Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-07-14 16:54 +0200
      Re: Retrieve a select from a table cell "Christoph M. Becker" <cmbecker69@arcor.de> - 2015-07-14 23:20 +0200
    Re: Retrieve a select from a table cell "danca (Daniele Campagna)" <cyberdanny@tiscalinet.it> - 2015-07-15 09:11 +0200
  Re: Retrieve a select from a table cell Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-07-14 21:36 +0200
    Re: Retrieve a select from a table cell Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-07-14 21:41 +0200
    Re: Retrieve a select from a table cell "danca (Daniele Campagna)" <cyberdanny@tiscalinet.it> - 2015-07-15 09:10 +0200
      Re: Retrieve a select from a table cell Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-07-15 09:46 +0200
        Re: Retrieve a select from a table cell "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-07-15 10:03 +0200
          Re: Retrieve a select from a table cell "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2015-07-15 06:33 -0700
        Re: Retrieve a select from a table cell "danca (Daniele Campagna)" <cyberdanny@tiscalinet.it> - 2015-07-15 10:17 +0200
          Re: Retrieve a select from a table cell Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-07-15 11:47 +0200
            Re: Retrieve a select from a table cell "danca (Daniele Campagna)" <cyberdanny@tiscalinet.it> - 2015-07-15 13:11 +0200
              Re: Retrieve a select from a table cell Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-07-18 18:04 +0200
  Re: Retrieve a select from a table cell Joao Rodrigues <groups_jr-1@yahoo.com.br> - 2015-07-14 16:44 -0300
    Re: Retrieve a select from a table cell Joao Rodrigues <groups_jr-1@yahoo.com.br> - 2015-07-14 17:03 -0300
      Re: Retrieve a select from a table cell Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-07-14 22:07 +0200
        Re: Retrieve a select from a table cell Joao Rodrigues <groups_jr-1@yahoo.com.br> - 2015-07-14 17:28 -0300
          Re: Retrieve a select from a table cell Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-07-15 00:23 +0200
    Re: Retrieve a select from a table cell Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-07-14 22:02 +0200

csiph-web