Hi All,
I could use a little help from a coding guru.
I’ve created a submission form that’s only for use by registered users who are not members of an organization. (Their user account has a field with the value of ‘non_member’)
For a field in that form I’m pulling the options from an array of ‘title’ values from a multi record table (Master Exhibition List).
Each record in the Master Exhibition List table has only two fields, a text field called ‘title’ and a check box called ‘members_only’. Both are required fields.
What I need to accomplish is to only allow the form to be submitted if the value of the ‘members_only’ check box that matches the option value chosen by the user is ‘0'.
If it's ‘1', I’d need to display: $errorsAndAlerts = This exhibition only accepts submissions from members.
The entire viewer is attached, but the code that pulls the 'title' options from the ‘Master Exhibition List’ table is:
<?php
$names = array();
foreach ($master_exhibition_listRecords as $record){
$names[$record['title']]=$record['title'];
}
?>
And the field in the form is:
<option value=""><span class="body-text-bold">Select an Exhibition Name</span></option>
<?php foreach($names as $name): ?>
<option value="<?php echo $name;?>"><?php echo $name;?></option>
<?php endforeach?>
</select>
I started messing with this but don’t know where to go with it.
<?php
$member_only = array();
foreach ($master_exhibition_listRecords as $record){
$member_only[$record['member_only']]=$record['member_only'];
}
?>
Any ideas?
Thanks,
Jerry Kornbluth
The first CMS Builder reference book is now available on-line!
Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php