This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use the new forum.
Home » support » symfony 1.3 and 1.4 » Customize forms not submitting
Customize forms not submitting [message #102438] Tue, 13 July 2010 20:04 Go to next message
nodoso  is currently offline nodoso
Messages: 7
Registered: July 2010
Junior Member
Hey

I tried a tutorial step by step to customize my forms in symfony. But when I did that my form is submitted but no action is taking I probably did something wrong but I followed every step.

Followed tutorial:
http://www.symfony-project.org/forms/1_4/en/03-Forms-for-web -Designers

I am stuck and don't know how to solve this problem so here is my code:



newSucces.php
<h1>Registration</h1>

<form action="<?php echo url_for('player/new') ?>" method="POST">
    <table>
        <tr>
            <th><?php echo $form['nickname']->renderLabel('Pseudo') ?>:</th>
            <td colspan="3">
                <?php echo $form['nickname']->renderError() ?>
                <?php echo $form['nickname'] ?>
            </td>
        </tr>
        <tr>
            <th><?php echo $form['password']->renderLabel() ?>:</th>
            <td>
                <?php echo $form['password']->renderError() ?>
                <?php echo $form['password'] ?>
            </td>
            <th><?php echo $form['password_check']->renderLabel() ?>:</th>
            <td>
                <?php echo $form['password_check']->renderError() ?>
                <?php echo $form['password_check'] ?>
            </td>
        </tr>
        <tr>
            <th><?php echo $form['birthdate']->renderLabel() ?>:</th>

            <td colspan="3">
                <?php echo $form['birthdate']->renderError() ?>
                <?php echo $form['birthdate'] ?>
            </td>
        </tr>
        <tr>
            <th><?php echo $form['email']->renderLabel() ?>:</th>
            <td colspan="3">
                <?php echo $form['email']->renderError() ?>
                <?php echo $form['email'] ?>
            </td>
        </tr>
        <tr>
            <th><?php echo $form['avatar']->renderLabel() ?>:</th>
            <td colspan="3">
                <?php echo $form['avatar']->renderError() ?>
                <?php echo $form['avatar'] ?>
            </td>
        </tr>
        <tr>
            <?php $form->renderGlobalErrors() ?>
            <td colspan="4">
                <input type="submit" />
            </td>
        </tr>
    </table>
</form>


Thanks
Re: Customize forms not submitting [message #102577 is a reply to message #102438 ] Fri, 16 July 2010 11:24 Go to previous messageGo to next message
zsoltk  is currently offline zsoltk
Messages: 5
Registered: July 2010
Location: Budapest
Junior Member
Hello,

You write, your "form is submitted but no action is taking". Then showing your form markup is maybe not as relevant. What's in your routing config, and what's in the player/new action?

Regards
Re: Customize forms not submitting [message #102581 is a reply to message #102577 ] Fri, 16 July 2010 11:36 Go to previous messageGo to next message
trontank  is currently offline trontank
Messages: 179
Registered: July 2008
Location: Germany
Senior Member
I'm guessing the form is not valid because the csrf_token is missing. Try this:

<tr>
  <?php echo $form['_csrf_token'] ?>
  <?php echo $form->renderGlobalErrors() ?>
  <td colspan="4">
    <input type="submit" />
  </td>
</tr>


Also, you forget echo before $form->renderGlobalErrors().
Re: Customize forms not submitting [message #102582 is a reply to message #102438 ] Fri, 16 July 2010 11:47 Go to previous message
nodoso  is currently offline nodoso
Messages: 7
Registered: July 2010
Junior Member
Thanks for the help guys.
The error was in my routing was submitting the form to new instead of create.

Thanks
Previous Topic:web site symfony google map ?
Next Topic:upgrading from 1.2 to 1.4
Goto Forum:
  

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software