Checkboxes in User Profile from Accounts

14 posts by 3 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: May 10, 2011   (RSS)

By zip222 - May 9, 2011

This almost works. It allows the user to check the box if it isn't currently checked, but they can't uncheck it. If they do, and then click save, the status doesn't change - it stays checked.

Re: [zip222] Checkboxes in User Profile from Accounts

By Jason - May 9, 2011

Hi,

Could you please attach a copy of your .php file so I can take a closer look?

Thanks
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [zip222] Checkboxes in User Profile from Accounts

By Jason - May 10, 2011

Hi,

It looks like the issue is with this piece of code:

// prepopulate form with current user values
foreach ($CURRENT_USER as $name => $value) {
if (array_key_exists($name, $_REQUEST)) { continue; }
$_REQUEST[$name] = $value;
}


This code takes place before your update query and overwrites the values in the $_REQUEST array. You may be finding that other values on your form are not being changed either. I would suggest putting this loop lower down so that it executes only after your save has taken place.

Hope this helps
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/