Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8485619
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T20:41:56+00:00 2026-06-10T20:41:56+00:00

I am working on existing project. There are many forms like this: <?php echo

  • 0

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T20:41:58+00:00Added an answer on June 10, 2026 at 8:41 pm

    I always use the bracket version – even for jquery ajax submit. this way it works, by the way:

    var ids = new Array();
    var myCheckboxes = new Array();
    $("#ProductCalculation input:checked").each(function() {
        ids.push($(this).val());
    });
    ...
    $.ajax({
        dataType: 'json',
        type: "post",
        data: {
            'data[Product][product_calculation_id]': ids, 
            'data[Product][brand_id]': brands, 
            'data[Category][Category]': categories, 
            'data[Form][connect]': c
        },
        url: targeturl,
        beforeSend: function(xhr) {
            xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
        },
        success: function(html) {
            ...
        }
    });
    

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on existing project.Getting records something like this: $this->courses = Doctrine_Core::getTable('Course')->findByUserId($this->userId); Now
I'm working on an ASP.NET project that replaces many existing paper forms. One of
I've integrated ASP.NET MVC 3 project into existing Web Forms project. It was working
I am working on an existing project where there are some blue folders that
I just started working on an existing grails project where there is a lot
I'm working on extending an existing ASP.NET MVC project, and there are some oddities
I am working on an existing project, setup by another coder. I'm having some
I've just started working on an existing CakePHP project. I will be developing a
I am working on implementing Zend Framework within an existing project that has 2
I'm working on a project where the client wants to have existing pages dynamically

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.