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

  • SEARCH
  • Home
  • 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 9045147
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T11:11:56+00:00 2026-06-16T11:11:56+00:00

I have built a screen where an administrator can add and edit users. I’m

  • 0

I have built a screen where an administrator can add and edit users. I’m able to add users without issue, but when I was testing how users can be edited, I noticed that if I have more than one user, I’m only be able to edit the last user thats listed. I’m unable to edit any other user.

Here is my code:

<?php foreach ($personel as $person) { ?>
<div id="edituser<?php echo $person['Personel']['id']; ?>" class="modal" style="display:none;">
    <?php
        $edituserformname = "editUser" + $person['Personel']['id'];
    ?>
    <div class="modal-header">
        <a class="close" data-dismiss="modal">×</a>
        <h3>Edit User - <?php echo $person['Personel']['firstname']; ?> <?php echo $person['Personel']['surname']; ?></h3>
    </div>
    <div class="modal-body iframed">
        <?php echo $
        <?php 
            echo $this->Form->create('Personel', array(
                'class' => 'form-horizontal',
                'id' => $edituserformname
            ));
            echo $this->Form->input('id', array(
                'type' => 'hidden',
                'value' => $person['Personel']['id']
            ));
            echo $this->Form->input('firstname', array(
                'type' => 'text',
                'label' => 'First Name',
                'class' => 'span5',
                'value' => $person['Personel']['firstname']
            ));
            echo $this->Form->input('surname', array(
                'type' => 'text',
                'label' => 'Surname',
                'class' => 'span5',
                'value' => $person['Personel']['surname']
            ));
            echo $this->Form->input('email', array(
                'type' => 'text',
                'label' => 'E-Mail',
                'class' => 'span5',
                'value' => $person['Personel']['email']
            ));
            echo $this->Form->input('companyid', array(
                'type' => 'hidden',
                'value' => $company['Company']['id']
            ));
            echo $this->Form->input('accesslevel', array(
                'label' => 'Access Level',
                'options' => $roles,
                'empty' => 'Select Access Level',
                'class' => 'span5',
                'value' => $person['Personel']['accesslevel']
            ));
            $pocval = array('1' => 'Yes', '0' => 'No');
            echo $this->Form->input('poc', array(
                'label' => 'Point of Contact?',
                'options' => $pocval, 
                'value' => $person['Personel']['poc']
            ));
            echo $this->Form->input('password', array(
                'type' => 'text',
                'label' => 'Password',
                'class' => 'span5',
                'value' => $company['Personel']['password']
            ));
            echo $this->Form->input('telephone', array(
                'type' => 'text',
                'label' => 'Telephone',
                'class' => 'span5',
                'value' => $company['Personel']['telephone']
            ));
            echo $this->Form->input('type', array(
                'type' => 'hidden',
                'value' => '0'
            ));
         ?>
     </div>
    <div class="modal-footer">
        <?php
        echo $this->Form->submit('Save & Close', array(
                'type' => 'submit',
                'class' => 'btn btn-primary',
                'id' => 'editusermodal'
            ));
        echo $this->Form->end();
         ?>
    </div>
</div>
<?php } ?>

How can I fix this issue? I had an idea about using iFrame’s but I’m reluctant to use this method. I’d rather be able to do it through CakePHP.

Many 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-16T11:11:59+00:00Added an answer on June 16, 2026 at 11:11 am

    You don’t need to use iFrame’s. It doesn’t work because your Form doesn’t close correctly.

    The $this->Form->create() and $this->Form->end() should be outside the divs.

    Try the following:

    <?php
        echo $this->Form->create('Personel', array(
            'class' => 'form-horizontal',
            'id' => $edituserformname
        ));
    ?>
        <div class="modal-body iframed">
            <?php 
                echo $this->Form->input('id', array(
                    'type' => 'hidden',
                    'value' => $person['Personel']['id']
                ));
                echo $this->Form->input('firstname', array(
                    'type' => 'text',
                    'label' => 'First Name',
                    'class' => 'span5',
                    'value' => $person['Personel']['firstname']
                ));
                echo $this->Form->input('surname', array(
                    'type' => 'text',
                    'label' => 'Surname',
                    'class' => 'span5',
                    'value' => $person['Personel']['surname']
                ));
                echo $this->Form->input('email', array(
                    'type' => 'text',
                    'label' => 'E-Mail',
                    'class' => 'span5',
                    'value' => $person['Personel']['email']
                ));
                echo $this->Form->input('companyid', array(
                    'type' => 'hidden',
                    'value' => $company['Company']['id']
                ));
                echo $this->Form->input('accesslevel', array(
                    'label' => 'Access Level',
                    'options' => $roles,
                    'empty' => 'Select Access Level',
                    'class' => 'span5',
                    'value' => $person['Personel']['accesslevel']
                ));
                $pocval = array('1' => 'Yes', '0' => 'No');
                echo $this->Form->input('poc', array(
                    'label' => 'Point of Contact?',
                    'options' => $pocval, 
                    'value' => $person['Personel']['poc']
                ));
                echo $this->Form->input('password', array(
                    'type' => 'text',
                    'label' => 'Password',
                    'class' => 'span5',
                    'value' => $company['Personel']['password']
                ));
                echo $this->Form->input('telephone', array(
                    'type' => 'text',
                    'label' => 'Telephone',
                    'class' => 'span5',
                    'value' => $company['Personel']['telephone']
                ));
                echo $this->Form->input('type', array(
                    'type' => 'hidden',
                    'value' => '0'
                ));
             ?>
         </div>
        <div class="modal-footer">
            <?php
                echo $this->Form->submit('Save & Close', array(
                        'type' => 'submit',
                        'class' => 'btn btn-primary',
                        'id' => 'editusermodal'
                    ));
                 ?>
        </div>
    <?php 
        echo $this->Form->end(); 
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have built a touch screen application using Windows Forms. It works great but
I have built a stackview widget for home Screen but i dont know how
I have built the UI for my Google Chrome Extension, but I am trying
I have a website built on ZF. I don't know why but is lagging
Hi i have my app built for IOS version 5.1 but now i want
I have built a 'dynamic' site. Basically, there is a configuration database, where users
I am using zend framework. I have built a simple login screen. when the
I have recently built an application that shows you a camera preview on screen.
i have a app built in Xcode 4.5 with 4 inch screen/View controllers i
I have built a UI where the majority of what's on screen is put

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.