Gossamer Forum
Home : Products : Others : Gossamer Community :

checkbox for Privacy Policy

Quote Reply
checkbox for Privacy Policy
Hi Andy,
I need a checkbox for Privacy Policy in my Community registration form.
Can you tell me how to do this?

Matthias
gpaed.de
Quote Reply
Re: [Matthias70] checkbox for Privacy Policy In reply to
Mmm, untested, but in your signup form, add:

Code:
<input type="checkbox" name="accept_tos" id="accept_tos" value="ON"> accept the TOS

Code:
<script>
sub do_check() {
if (jQuery('#accept_tos').attr('checked')) {
alert("please accept our TOS");
return false;
}
return true;
}
</script>

..then in the <form bit, add:

Code:
onsubmit="return do_check();"

As I said, untested - but give it a go and see if it works =)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Quote Reply
Re: [Andy] checkbox for Privacy Policy In reply to
Hi Andy,
is this without an entry in the database?
But I need a additional field in the database...

Matthias
gpaed.de

Last edited by:

Matthias70: Mar 17, 2010, 12:04 PM
Quote Reply
Re: [Matthias70] checkbox for Privacy Policy In reply to
Why do you need it in the DB?

If you do, then try this:

Mmm, untested, but in your signup form, add:

Code:
<input type="checkbox" name="prof_accept_tos" id="prof_accept_tos" value="ON"> accept the TOS

Code:
<script>
sub do_check() {
if (jQuery('#prof_accept_tos').attr('checked')) {
alert("please accept our TOS");
return false;
}
return true;
}
</script>

..then in the <form bit, add:

Code:
onsubmit="return do_check();"

Once this is ticked, it should then update the "prof_accept_tos" field in their profile.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Quote Reply
Re: [Andy] checkbox for Privacy Policy In reply to
Hi Andy,
I would like to have this checkbox beside the automatic profile form.
Just like I have it with the random image.
And I don't want to use javascript in the registration form.

In glinks include_form.html I'm using this code
Code:
<div class="row clear">
<label for="agree" class="name">Check: <span>*</span><br><br><br><br><br><br><br><br></label>
<div class="value">
<input type="checkbox" id="agree" name="agree" value="Yes" <%if agree eq "Yes"%>checked<%endif%>> Text Text Text<br /><br />
</div>
</div>

Do you think this will work in community as well?

Matthias
gpaed.de
Quote Reply
Re: [Matthias70] checkbox for Privacy Policy In reply to
To have the field saved in GComm, you would need to just add it as another field in gcomm user signup Smile I believe you can use tickboxes.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Quote Reply
Re: [Andy] checkbox for Privacy Policy In reply to
Hi Andy,
in gcommunity admin I can only create columns for the automated profile form.
Can you tell me the mysql code for creating a field in the usertable
called agree
with the options
Form Values Yes
Form Names Yes

Matthias
gpaed.de
Quote Reply
Re: [Matthias70] checkbox for Privacy Policy In reply to
Hi,

Its not as simple as that ;) If you want the value added into the DB - it would need to be in the .def file (otherwise GComm will simply ignore it, even though it is in the table itself)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Quote Reply
Re: [Andy] checkbox for Privacy Policy In reply to
Hi Andy,
why is gcomm so complicated :-(

I created a field called prof_agree in the admin section, for the signup form.
Works fine!
Now I have the problem, that I need a text with a link, but the form value shows the link to the TOS in text but not in link form :-(

Matthias
gpaed.de
Quote Reply
Re: [Matthias70] checkbox for Privacy Policy In reply to
Yeah, is a bit of a PITA sometimes

Something you could try, is in /lib/Community/Web/SSI.pm, find:

Code:
$html .= ( $cols->{$col}->{not_null} ) ?
"<tr $opts->{tr}><td $opts->{td_l}>$title:</td><td $opts->{td_r}>$$input_html $opts->{required}</td></tr>" :
"<tr $opts->{tr}><td $opts->{td_l}>$title:</td><td $opts->{td_r}>$$input_html</td></tr>";

...try changign to:
Code:
my $extra_text;
if ($title eq "whatever your TOS field is named") {
$extra_text = qq|Please read our <a href="/tos.html">TOS</a>|;
}


$html .= ( $cols->{$col}->{not_null} ) ?
"<tr $opts->{tr}><td $opts->{td_l}>$title:</td><td $opts->{td_r}>$$input_html $opts->{required} $extra_text</td></tr>" :
"<tr $opts->{tr}><td $opts->{td_l}>$title:</td><td $opts->{td_r}>$$input_html $extra_text</td></tr>";

Untested, but something like that should work for what you need :)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Quote Reply
Re: [Andy] checkbox for Privacy Policy In reply to
Fortunately I don't need this workaround, cause the form display on the left side shows html :-)

Do you know how I can check this checkbox for all my already existing users?
At the moment it is unchecked for existing users...

Matthias
gpaed.de
Quote Reply
Re: [Matthias70] checkbox for Privacy Policy In reply to
Cool

To update, just run this SQL query:

UPDATE comm_users SET the_Field = 'YES'

(or whatever the value is for the checkbox field)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Quote Reply
Re: [Andy] checkbox for Privacy Policy In reply to
Thanks for your help, Andy

At GossamerThreads,
don't you think we need a new more flexible version of gcomm !!!

Matthias
gpaed.de