News:

Wondering if this will always be free?  See why free is better.

Main Menu

code for locking a checkbox? not hidden

Started by alosGs, April 24, 2006, 06:36:30 AM

Previous topic - Next topic

alosGs

i'm looking for a code to lock a checkbox, it will be checked but also locked, that the user can not uncheck it, i'm not looking for "hidden", just locked

Leipe Po

whats the use of having a checkbox that cannot be used?
There is only one thing more importend to me then coding:
My Girlfriend

Microsoft - "You've got questions.  We've got dancing paperclips."

Thantos

added disabled="disabled" to the <input> tag

alosGs

#3
Quote from: Leipe Po on April 24, 2006, 07:47:29 AM
whats the use of having a checkbox that cannot be used?

we are trying to make all user's e-mail "hide e-mail adress from public" automaticly
in the registration form, if we make the checkbox for that option checked and hidden, it doesn't work, it only works when its visible, but that way the user can uncheck it  ;) I tried this way, locked and checked, this also do not work
so the last idea is this:
the display.template must be modified, this code must be made like: only the admin can see the mail, (if we erase this, the admin will not see the mails also so we must add just the admin can see option)
      // Otherwise, show the guest's email.
      elseif (empty($message['member']['hide_email']))
         echo '
                        <br />
                        <br />
                        <a href="mailto:', $message['member']['email'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/email_sm.gif" alt="' . $txt[69] . '" title="' . $txt[69] . '" border="0" />' : $txt[69]), '</a>';


also the profile.template must be modified the same way:
// Only show the email address if it's not hidden.
if ($context['member']['email_public'])
echo '
<a href="mailto:', $context['member']['email'], '">', $context['member']['email'], '</a>';
// ... Or if the one looking at the profile is an admin they can see it anyway.
elseif (!$context['member']['hide_email'])
echo '
<i><a href="mailto:', $context['member']['email'], '">', $context['member']['email'], '</a></i>';
else
echo '
<i>', $txt[722], '</i>';



so if someone can do that :) no matter if its checked or unchecked in the registration form (we will make it hidden though) the users will not see others e-mail anywhere, just the admins will be able to see..

Advertisement: