I am working on existing project. There are many forms like this:
<?php echo $form->create('MyForm', array('id' => 'MyFormId')); ?>
<?php echo $form->input('User.0.username', array( 'label' => false, )); ?>
<?php echo $form->input('User.0.location', array( 'label' => false, )); ?>
<?php echo $form->end(); ?>
It is generating form elements like this:
<input type="text" id="User0Username" name="data[User][0][username]">
<input type="text" id="User0Location" name="data[User][0][location]">
Bu I want them to be look like this:
<input type="text" id="User0Username" name="User_0_username">
<input type="text" id="User0Location" name="User_0_location">
Is there any $form->create(); function option to get this html instead of changing my forms elements?
Thanks
I always use the bracket version – even for jquery ajax submit. this way it works, by the way:
you can manually grab the form elements. not ideal, but it does not break cake-styled coding
i am also sure one could write a jquery plugin to make this automatically in some way. that is actually quite an interesting thing to do.