Start swearing me.

After a good night sleep I was able to see that the id for the submit button
was 'submit' and for some reason which I can't understand, JS was unable to
make the difference between submit as an id (even thou i was passing it
trough document.getElementById) and  submit as a function.

On Sun, Jun 20, 2010 at 9:41 AM, Andrei Mita <[email protected]> wrote:

> That's how FireBug reports the error, without brackets. I have them in the
> code.
>
>
>
> On Sat, Jun 19, 2010 at 11:34 PM, John Andersen 
> <[email protected]>wrote:
>
>> My last comment before going to bed :)
>>
>> Is this your code or again a typo?
>> [code]
>> document.getElementById("GameAnswerForm").submit
>> [/code]
>>
>> Observe that you must end the statement as ... submit() !! With
>> brackets, so javascript understand that it is a function/method!
>> Enjoy,
>>   John
>>
>>
>> On Jun 19, 10:30 pm, Andrei Mita <[email protected]> wrote:
>> > This is from the view source:
>> > <form class="iform" id="GameAnswerForm" method="post"
>> > action="/myf/games/answer" accept-charset="utf-8"><div
>> > style="display:none;"><input type="hidden" name="_method" value="POST"
>> > /></div>
>> >
>> > Yes, it was a typo. Now it it's:
>> > document.getElementById("GameAnswerForm").submit
>> > is not a function
>> >
>> > The funny thing is that I've tried to trigger the function from the
>> submit
>> > button with onclick and it works. Currently I am trying to trigger the
>> same
>> > function from within another function which counts down from 10.
>> >
>> > This probably means that I have a problem in some other place, making it
>> a
>> > non-cake problem. This in turn means you'll hate me for making you lose
>> > time.
>> >
>> > I'll look into it and let you know so that you could curse me
>> accordingly.
>> >
>> >
>> >
>> > On Sat, Jun 19, 2010 at 10:11 PM, cricket <[email protected]>
>> wrote:
>> >
>> > > On Jun 19, 2:49 pm, Andrei Mita <[email protected]> wrote:
>> > > > John, I really appreciate you taking the time testing my problem.
>> > However,
>> > > > it still doesn't work for.
>> > > > The error: document.getElementById("GameAnswerFrom") is null
>> >
>> > > Two things: Viewing source, what ID do you see on the form element?
>> >
>> > > And it looks like you have a typo in the JS:  "GameAnswerFrom"
>> >
>> > > > I think I'm going crazy here
>> >
>> > > Ain't it the truth. Learning a new framework can be maddening but I
>> > > live for those "aha!" moments. The preceding hours of frantic anxiety
>> > > and fevered despair make it that much sweeter, I guess.
>> >
>> > > > but I did found something interesting.
>> >
>> > > > When form->create is called, cake adds a hidden input. It also does
>> this
>> > for
>> > > > radio buttons. I discovered by mistake that if I leave those hidden
>> > fields,
>> > > > I can't run a js scrip for styling radio buttons.
>> >
>> > > > So, maybe the same goes here. Is there any way to get rid off that
>> > hidden
>> > > > field next to the form? The manual says nothing.
>> >
>> > > Maybe the JS just needs to be tightened up a little. If it's for
>> > > styling buttons it shouldn't affect any hidden inputs. It likely just
>> > > needs to be more specific.
>> >
>> > > If the styling can be achieved directly with CSS alone, all the
>> better.
>> >
>> > > Check out the new CakePHP Questions sitehttp://cakeqs.organd help
>> others
>> >
>> > with their CakePHP related questions.
>> >
>> > > You received this message because you are subscribed to the Google
>> Groups
>> > "CakePHP" group.
>> > > To post to this group, send email to [email protected]
>> > > To unsubscribe from this group, send email to
>> > > [email protected]<cake-php%[email protected]>
>> <cake-php%[email protected]<cake-php%[email protected]>>For
>> more options, visit this group at
>> >
>> > http://groups.google.com/group/cake-php?hl=en
>>
>> Check out the new CakePHP Questions site http://cakeqs.org and help
>> others with their CakePHP related questions.
>>
>> You received this message because you are subscribed to the Google Groups
>> "CakePHP" group.
>> To post to this group, send email to [email protected]
>> To unsubscribe from this group, send email to
>> [email protected]<cake-php%[email protected]>For
>>  more options, visit this group at
>> http://groups.google.com/group/cake-php?hl=en
>>
>
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to