pr0blems / phpquery

Automatically exported from code.google.com/p/phpquery
0 stars 0 forks source link

:input selector doesn't contain textarea/select elements #146

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. using pq(':input')

What is the expected output? What do you see instead?
*The result must contain select and textarea elements

What version of the product are you using? On what operating system?
*version 0.9.5

Please provide any additional information below.

*I think these are wrong code. (from line:2067)

case 'input':
  $this->elements = $this->map(
    array($this, 'is'),
    'input', new CallbackParam()
  )->elements;

*Perhaps, followings is correct.

case 'input':
  $this->elements = phpQuery::merge(
    $this->map(array($this, 'is'), 'input', new CallbackParam()),
    $this->map(array($this, 'is'), 'select', new CallbackParam()),
    $this->map(array($this, 'is'), 'textarea', new CallbackParam())
  );

Original issue reported on code.google.com by tope...@gmail.com on 18 Apr 2010 at 6:18

GoogleCodeExporter commented 8 years ago
It should also match buttons. From the jQuery API:

«jQuery(':input')
Description: Selects all input, textarea, select and button elements.
The :input selector basically selects all form controls.»

http://api.jquery.com/input-selector/

Original comment by kAlvaro on 7 Jun 2010 at 10:42