It all takes place in this view: question.ctp

<? echo $form->create('Game', array('action' => 'answer', 'name' =>
'GameAnswerForm','class'=>'iform'));?>
<input type="radio" value="<?=$options[0];?>" name="answer"
class="styled"><?=$options[0];?>
//not using $form->radio because i din't figure out how to remove the div
which comes with the radio btns
<?echo '<ul><li>'.$form->submit('Answer!', array('class'=>'itext', 'id'=>
'submit')).'</li></ul>';?>
<?echo $form->input('speed', array('type'=> 'hidden'));?>
<?echo $form->end();?>

And the submit is in the countdown.js file:

function myFunction() {
    document.getElementById('submit').disabled=true;
    document.getElementById('submit').value='Wait...';
    GameAnswerForm.submit()
}

The code is stripped down from what I think is unnecessary. If needed, I'll
paste everything in here. Thanks.


On Sat, Jun 19, 2010 at 5:22 PM, John Andersen <[email protected]>wrote:

> Have you compared the HTML when you create the form the old fashion
> way with the way CakePHP creates it?
> Can you show the CakePHP created form code?
> Can you show the javascript invoking the form submit?
> Can you show the view code (copy/paste here) where the form->create
> statement is located?
> That will give us some more information with which to try to help
> you :)
> Enjoy,
>   John
>
> On Jun 19, 5:09 pm, Andrei Mita <[email protected]> wrote:
> > I have created a form with:
> >
> > $form->create('Game', array('action' => 'answer', 'class'=>'iform'));
> >
> > which results in a form with the id GameAnswerForm
> >
> > When I try to run a js script with GameAnswerForm.submit() inside,
> firebug
> > pops up an error saying GameAnswerForm is not defined. I have tried
> adding
> > name param inside array and nothing happens.
> >
> > If I create a form the old fashion way, everything works fine.
> >
> > I am going nuts over this one. Thanks.
>
> 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