On 12 Jul 2010, at 20:56, Michael Jones wrote:

> Just curious why you would use those methods instead of just accessing the
> named element directly?  Seems like they aren't as specific and potentially
> add more work.

In Merrill's example, his input field didn't have an ID, so staying true to his 
code, I was unable to access it by ID. And, since the name is an array 
collection, I'm not sure how to access it by name directly. Is there a way?


> On Mon, Jul 12, 2010 at 6:43 PM, Wade Preston Shearer <
> [email protected]> wrote:
> 
>> On 12 Jul 2010, at 17:25, Merrill Oveson wrote:
>> 
>> With jQuery, I'd do it like this:
>> 
>> http://anavidesign.com/temp/jquery.html
> 
> This is going to attach to all input elements though. If you just needed the
> value of the item_position element, you'd want to set an ID and use the
> selector on that particular item, no?
> 
> $('input').change(function() {

Yes, I just wrote the code generally as an example.


>> With raw javascript, like this:
>> 
>> http://anavidesign.com/temp/raw.html
> 
> The main problem with this is knowing which element is which. Is there any
> benefit to using .elements[n] over using the named item? I'm pretty sure
> named elements work in all recent browsers (IE 6+ included).

I'm not sure if IE 6 supports it or not, but yes, I believe the most recent 
versions of the major browsers do now support selecting by name. But, once 
again, I'm not sure how that works with the array grouping.

_______________________________________________

UPHPU mailing list
[email protected]
http://uphpu.org/mailman/listinfo/uphpu
IRC: #uphpu on irc.freenode.net

Reply via email to