View Full Version : Checkboxes In Signup.php
Steve Palmquist
10-20-2003, 08:02 AM
Alex, has there been any progress on making checkboxes available for signup.php/profile.php? I have a lot of demographics that I want to track for my members and checkboxes would really help.
Thanks,
Steve
alex-adm
11-03-2003, 07:34 PM
unfortunately, it is impossible in current version. however, it is possible to replace checkboxes with select boxes in admin area (checkboxes keeps on the signup page).
mikebridge
11-13-2003, 04:05 PM
The FAQ item "Adding Fields" says
"3. To add SELECT/RADIO fields"
but it only shows how to add a select field.
Is it possible to provide an example of how to add a radio button?
Thanks,
Mike
alex-adm
11-14-2003, 05:52 AM
Change will be in template:
instead of
<tr>
<th><b>Where did you hear about us?</b><br>
<small>please stell us how you heard about out site.</small></th>
<td nowrap><select name=where_heard size=1>
{html_options options=$config.where_heard_items selected=$smarty.request.where_heard}
</select>
</td>
</tr>
use:
<tr>
<th><b>Where did you hear about us?</b><br>
<small>please stell us how you heard about out site.</small></th>
<td nowrap>
{foreach from=$config.where_heard_items key=v item=v}
<input type=radio name=where_heard value="{$k}" {if $k==$smarty.request.where_heard}checked{/if}>{$v}<br>
{/foreach}
</td>
</tr>
Unregistered
01-31-2004, 11:12 AM
Change will be in template:
instead of
<tr>
<th><b>Where did you hear about us?</b><br>
<small>please stell us how you heard about out site.</small></th>
<td nowrap><select name=where_heard size=1>
{html_options options=$config.where_heard_items selected=$smarty.request.where_heard}
</select>
</td>
</tr>
use:
<tr>
<th><b>Where did you hear about us?</b><br>
<small>please stell us how you heard about out site.</small></th>
<td nowrap>
{foreach from=$config.where_heard_items key=v item=v}
<input type=radio name=where_heard value="{$k}" {if $k==$smarty.request.where_heard}checked{/if}>{$v}<br>
{/foreach}
</td>
</tr>
Below is my scripts. But it didn't show the existed value when I try to edit profile. It only show in admin panel.
See what did I miss? Thanks.
In config_inc.php
add_member_field('student', 'You Are',
'radio', 'student',
'',
array('options' => $items = array(
'student' => 'Student',
'non-student' => 'Non-student'
))
);
$config['student_items'] = $items;
In profile.html
<tr>
<th width=40%><b>Form Studying</b><br>
</th>
<td nowrap><select name=student_level id=student_level size=1>
{html_options options=$config.student_level_items selected=$user.student_level}
</select>
</td>
</tr>
Unregistered
01-31-2004, 11:16 AM
Sorry this is the correct scripts in config.inc.php
In config_inc.php
add_member_field('student_level', 'Form Studying',
'select', 'form studying',
'',
array('options' => $items = array(
'k1' => 'K1',
'k2' => 'K2',
'k3' => 'K3',
'p1' => 'P1',
'p2' => 'P2',
'p3' => 'P3',
'p4' => 'P4',
'p5' => 'P5',
'p6' => 'P6',
'f1' => 'F1',
'f2' => 'F2',
'f3' => 'F3',
'f4' => 'F4',
'f5' => 'F5',
'f6' => 'F6',
'f7' => 'F7',
'undergraduate' => 'Undergraduate',
'postgraduate' => 'Postgraduate'
))
);
$config['student_level_items'] = $items;
Unregistered
01-31-2004, 09:02 PM
Do you use Pro version?
Yes, I am using 1.9.3RC22PRO
please email your config.inc.php to support@cgi-central.net
vBulletin® v3.8.4, Copyright ©2000-2010, Jelsoft Enterprises Ltd.