[Proto-Scripty] Re: $H need help

2009-08-26 Thread Kevin Porter
Nah, it doesn't like the 'input.id' as an object key. Object keys must be literals. He'll have to assign that key with .set() before passing the hash into the update() function. - Kev ColinFine wrote: > > On Aug 26, 1:09 am, buda wrote: > >> I need to put into hash pairs: >> >> input1.id

[Proto-Scripty] Re: $H need help

2009-08-26 Thread ColinFine
On Aug 26, 1:09 am, buda wrote: > I need to put into hash pairs: > > input1.id : input1.getValue >     > inputN.id : inputN.getValue > > where N may be from 5 to 25 > In that case, update is the right tool, and I can't see anything wrong with your initial syntax. Could the error be somewhe

[Proto-Scripty] Re: $H need help

2009-08-25 Thread buda
Thanks everyone for your help ! :) On 26 авг, 03:16, DJ Mangus wrote: > ok, h.update is correct if you want to send it multiple values at > once, if you do not know exactly how many items you will be adding at > once until runtime, you'd have to loop anyway to build the object to > send to h.upd

[Proto-Scripty] Re: $H need help

2009-08-25 Thread DJ Mangus
ok, h.update is correct if you want to send it multiple values at once, if you do not know exactly how many items you will be adding at once until runtime, you'd have to loop anyway to build the object to send to h.update. In that case just loop over them once and add to the hash Something like:

[Proto-Scripty] Re: $H need help

2009-08-25 Thread buda
I need to put into hash pairs: input1.id : input1.getValue inputN.id : inputN.getValue where N may be from 5 to 25 On 26 авг, 02:46, DJ Mangus wrote: > gah, just looked at the source, I was wrong about that, ignore the last > message I sent. > > > > On Tue, Aug 25, 2009 at 4:41 PM, D

[Proto-Scripty] Re: $H need help

2009-08-25 Thread DJ Mangus
gah, just looked at the source, I was wrong about that, ignore the last message I sent. On Tue, Aug 25, 2009 at 4:41 PM, DJ Mangus wrote: > if you feed set() an object it should set multiple key/value pairs at once. > > > On Tue, Aug 25, 2009 at 4:32 PM, Kevin Porter wrote: > >> >> >> What do y

[Proto-Scripty] Re: $H need help

2009-08-25 Thread DJ Mangus
if you feed set() an object it should set multiple key/value pairs at once. On Tue, Aug 25, 2009 at 4:32 PM, Kevin Porter wrote: > > > What do you mean by 'some pairs'? > > Looks like set() is what you want. > > What do you want your hash to look like before and after? > > - Kev > > buda wrote:

[Proto-Scripty] Re: $H need help

2009-08-25 Thread Kevin Porter
What do you mean by 'some pairs'? Looks like set() is what you want. What do you want your hash to look like before and after? - Kev buda wrote: > Sorry for not full description of my task - I need to add some pairs > to a hash - so set() doesnt hepl me :( > > On 26 авг, 01:18, Kevin Porter

[Proto-Scripty] Re: $H need help

2009-08-25 Thread buda
Sorry for not full description of my task - I need to add some pairs to a hash - so set() doesnt hepl me :( On 26 авг, 01:18, Kevin Porter wrote: > Oops sorry! Posted without testing, I didn't realise you lost that > assignment notation with a $H() hash. > > - Kev > > > > > > DJ Mangus wrote: >

[Proto-Scripty] Re: $H need help

2009-08-25 Thread Kevin Porter
Oops sorry! Posted without testing, I didn't realise you lost that assignment notation with a $H() hash. - Kev DJ Mangus wrote: > what you want to do is h.set(input.id , > input.getValue()) > > See http://www.prototypejs.org/api/hash/set > > 2009/8/25 Kevin Porter mailto:k...

[Proto-Scripty] Re: $H need help

2009-08-25 Thread DJ Mangus
oh, forgot to mention instead of input.id you might want to use input.identify() as it will return the id, or if the element is missing an id, assign one and then return the assignment. On Tue, Aug 25, 2009 at 2:55 PM, DJ Mangus wrote: > what you want to do is h.set(input.id, input.getValue()) >

[Proto-Scripty] Re: $H need help

2009-08-25 Thread DJ Mangus
what you want to do is h.set(input.id, input.getValue()) See http://www.prototypejs.org/api/hash/set 2009/8/25 Kevin Porter > > Same: > > var h = $H({}); > h[input.id] = input.getValue(); > > - Kev > > > buda wrote: > > Thanks for replay, but > > I Do need to add it to a $H object > > > > h

[Proto-Scripty] Re: $H need help

2009-08-25 Thread Kevin Porter
Same: var h = $H({}); h[input.id] = input.getValue(); - Kev buda wrote: > Thanks for replay, but > I Do need to add it to a $H object > > how to do it? Thanks ) > > On 26 авг, 00:14, Kevin Porter wrote: > >> var h = {}; >> h[input.id] = input.getValue(); >> >> Doesn't even need to be

[Proto-Scripty] Re: $H need help

2009-08-25 Thread buda
Thanks for replay, but I Do need to add it to a $H object how to do it? Thanks ) On 26 авг, 00:14, Kevin Porter wrote: > var h = {}; > h[input.id] = input.getValue(); > > Doesn't even need to be a $H(), just a regular JS object/hash. > > - Kev > > > > > > buda wrote: > > I need to add to a

[Proto-Scripty] Re: $H need help

2009-08-25 Thread Kevin Porter
var h = {}; h[input.id] = input.getValue(); Doesn't even need to be a $H(), just a regular JS object/hash. - Kev buda wrote: > I need to add to a hash id of an input and its value > when I try to do > > var h = $H({}); > h.update({ input.id: input.getValue() }); > > an error of bad syntax is