multiple pulldown or checkboxes
2 posts by 2 authors in: Forums > CMS Builder
Last Post: March 23, 2011 (RSS)
By 4cdg - March 23, 2011
I am setting up a site that has password protected areas so only certain users can see certain files.
I have used the cms cookbook to setup this before, but what I am trying to do is not working. I have a section called files that is a multiple section editor. each record then has a field that populates a list of the accounts. I want to be able to select multiple accounts and give them access to an individual record. everything works if i use a pulldown or radio box for the user selection but i need multiple selections to work. also when i login as admin I can see all the records in my viewer.
the where statement on my viewer is this
'where' => " (user_access = '{$CURRENT_USER['num']}') OR '{$CURRENT_USER['isAdmin']}'",
user_access is the pulldown list
I can send you the code and the urls
I have used the cms cookbook to setup this before, but what I am trying to do is not working. I have a section called files that is a multiple section editor. each record then has a field that populates a list of the accounts. I want to be able to select multiple accounts and give them access to an individual record. everything works if i use a pulldown or radio box for the user selection but i need multiple selections to work. also when i login as admin I can see all the records in my viewer.
the where statement on my viewer is this
'where' => " (user_access = '{$CURRENT_USER['num']}') OR '{$CURRENT_USER['isAdmin']}'",
user_access is the pulldown list
I can send you the code and the urls
Re: [4cdg] multiple pulldown or checkboxes
By Jason - March 23, 2011
Hi,
If you're searching as part of a multi-select list, you need to use the LIKE operator and put tab characters before and after your search option. Try this:
Hope this helps
If you're searching as part of a multi-select list, you need to use the LIKE operator and put tab characters before and after your search option. Try this:
'where' => "user_access LIKE '%\t". intval($CURRENT_USER['num'])."\t%'",
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/
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/