Closed GoogleCodeExporter closed 8 years ago
Perhaps that's the same problem that issue 82.
And so perhaps other method should be fix too ?
Original comment by nicolas....@gmail.com
on 1 Dec 2008 at 8:28
Can't reproduce it. Need more information. Code below works as expected:
$doc = phpQuery::newDocument('<input name="test1" value="old1"/> <input
name="test2"
value="old2"/>');
print $doc['input']->val('new');
Original comment by tobiasz....@gmail.com
on 1 Dec 2008 at 8:41
Should make some test more so.
Have test it using the selector "[name=toto]" and a DOM like <dom><select
name="toto"><option></option><option value="1">1</option></select><div><input
type="hidden" name="toto"/></div></dom>.
And so doing <php>$mySetOfElements = $myDOM->find('[name="toto"]');</php>, and
so
<php>$mySetOfElements->length();</php> give me "2" but
<php>$mySetOfElements->val(1);</php> doesn't set the value of the input element.
Original comment by nicolas....@gmail.com
on 1 Dec 2008 at 8:57
note that i've replaced <php>$mySetOfElements->val(1);</php> by <php>foreach
($mySetOfElements as $element) pQ($element)->val(1);</php> and it works.
Original comment by nicolas....@gmail.com
on 1 Dec 2008 at 9:01
Fixed in r311. Problem existed when matched elements contained at least one
select.
Original comment by tobiasz....@gmail.com
on 1 Dec 2008 at 9:21
Thanks tobiaz !
Original comment by nicolas....@gmail.com
on 1 Dec 2008 at 9:25
tobiaS :x
Original comment by nicolas....@gmail.com
on 1 Dec 2008 at 9:26
Original issue reported on code.google.com by
nicolas....@gmail.com
on 30 Nov 2008 at 11:06