Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Checkbox - Terms of agreement

Quote Reply
Checkbox - Terms of agreement
Hi
I have searched the links forums for a way to integrate a checkbox in add.cgi.

This checkbox must be clicked before a user can submit a link.
Does anybody know how to set this up in gossamer links?

Perhaps there is already a thread and I'm using the wrong searchwords ?

Thanks
Matthias

Matthias
gpaed.de
Quote Reply
Re: [Matthias70] Checkbox - Terms of agreement In reply to
There are couple ways you can do this.

1) Setup a javascript on the page that will verify if the box is checked or not.
2) Easiest is, create a new link property column and set it to required. So they will be able to submit link only if the box is checked.

Hope this helps.

Vishal
-------------------------------------------------------
Quote Reply
Re: [Matthias70] Checkbox - Terms of agreement In reply to
Will a simple javascript test not be sufficient?
Quote Reply
Re: [Wychwood] Checkbox - Terms of agreement In reply to
Hi thanks for your replies,
but I don't want to use java script.

I tried it with a new column in the database but I got some problems

This is the new column. I set not null to yes
31 agree ENUM(yes, no) Yes no Agreement CHECKBOX
Column values are: yes/no
Form names are: yes/no
Form values are: yes/no



Thats the code I put in include_form.html


Code:
<div class="row clear">
<label for="agree" class="name">Agreement:</label>
<div class="value">
<input type="checkbox" id="agree" name="agree" value="<%if agree%><%escape_html agree%><%endif%>" class="text" />
</div>

Now I have a checkbox in add.cgi but when it's unchecked the link is still submitted?

Did I miss something?

Matthias

Matthias
gpaed.de
Quote Reply
Re: [Matthias70] Checkbox - Terms of agreement In reply to
Form Values Should be Yes, Not Yes/NO
Form Names Should be Yes, Not Yes/No


<div class="row required clear">
<label for="Agreement" class="name">Agreement: <span>*</span></label>
<div class="value">
<input type="checkbox" id="Agreement" name="Agreement" value="Yes" <%if Agreement eq "Yes"%>checked<%endif%>> I have read and agreed to the
Agreement.
</div>
</div>

This makes them check the checkbox saying they agree!
Quote Reply
Re: [rascal] Checkbox - Terms of agreement In reply to
Thanks rascal,
I would'nt know what to do without this forum and the great supporters.
First I thougt Andy is on his own, but there are few more.
Thanks to SWDevil.Com and Wychwood too.

Matthias

Matthias
gpaed.de