Friday, April 2, 2010

Spry Checkbox Not Locking Out 'Enter'...

I am trying to develop an Age-Authorization and Privacy Policy into page where users MUST check the boxes ''I am over 18'' and ''I agree to the User and Privacy Policies'' before they are allowed to hit the 'ENTER' button.?I have it set up where if you hit the ENTER button and the checboxes are NOT checked, it lets you know that you must agree to the terms and conditions; BUT it will not stop them from entering the page without checking the boxes. I want to develop the site so you MUST check both boxes before the link allows you to click on it to enter the site.?Here is the code below, and i'm hoping that someone can help me on this. I am a new developer and don't know much about Spry. I have ommited the site information with Asterisks for privacy purposes.?Thank you.

%26lt;a href=http://WEBSITE REMOVED FOR PRIVACY title=''ENTER''%26gt;ENTER HERE%26lt;/a%26gt;

The Underlined, Boldface ''ENTER HERE'' in the code is the actual clickable link I want to link to the checkboxes before letting them access the site.

---------------------------START OF CODE------------------------------

%26lt;!DOCTYPE html PUBLIC ''-//W3C//DTD XHTML 1.0 Transitional//EN'' ''http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd''%26gt;
%26lt;html xmlns=''http://www.w3.org/1999/xhtml''%26gt;
%26lt;head%26gt;
%26lt;meta http-equiv=''Content-Type'' content=''text/html; charset=utf-8'' /%26gt;
%26lt;title%26gt;WEBSITE NAME REMOVED FOR PRIVACY - Enter Here%26lt;/title%26gt;
%26lt;style type=''text/css''%26gt;
%26lt;!--
body {
background-color: #000000;
}
--%26gt;
%26lt;/style%26gt;
%26lt;link href=''../../../joomla.css'' rel=''stylesheet'' type=''text/css'' /%26gt;
%26lt;style type=''text/css''%26gt;
%26lt;!--
.style5 {
font-family: Verdana, Arial, Helvetica, sans-serif;
color: #64EDF4;
}
--%26gt;

%26lt;/style%26gt;
%26lt;script src=''SpryAssets/SpryValidationCheckbox.js'' type=''text/javascript''%26gt;%26lt;/script%26gt;
%26lt;link href=''SpryAssets/SpryValidationCheckbox.css'' rel=''stylesheet'' type=''text/css'' /%26gt;
%26lt;/head%26gt;

%26lt;body%26gt;
%26lt;form action='''' method=''post'' name=''form1'' class=''style5'' id=''form1''%26gt;
?%26lt;label%26gt;
?%26lt;div align=''center'' onclick=''sprycheckbox2.validate();sprycheckbox1.validate()''%26gt;
?%26lt;p%26gt;%26lt;br /%26gt;
?WEBSITE NAME REMOVED FOR PRIVACY%26lt;br /%26gt;
?%26lt;br /%26gt;
?WEBSITE DESCRIPTION REMOVED FOR PRIVACY.%26lt;br /%26gt;
?%26lt;br /%26gt;
?Otherwise, Please read our User and Policy agreements, Check the box below, and enter the site.%26lt;/p%26gt;
?%26lt;p%26gt;%26lt;br /%26gt;
?%26lt;/p%26gt;
?%26lt;span id=''sprycheckbox1''%26gt;
?%26lt;label%26gt;
?%26lt;input name=''agreepolicy'' type=''checkbox'' id=''agreepolicy'' /%26gt;
?I Agree with the User Policy and Privacy Policy%26lt;/label%26gt;
?%26lt;span class=''checkboxRequiredMsg''%26gt;Please Accept our Policies.%26lt;/span%26gt;%26lt;/span%26gt;%26lt;br /%26gt;
?%26lt;span id=''sprycheckbox2''%26gt;
?%26lt;label%26gt;
?%26lt;input type=''checkbox'' name=''over18'' id=''over18'' /%26gt;
?I Contest that I am over 18 years of age%26lt;/label%26gt;
?%26lt;span class=''checkboxRequiredMsg''%26gt;Need to Validate your Age.%26lt;/span%26gt;%26lt;/span%26gt;
?%26lt;p%26gt;
?%26lt;br /%26gt;
?Thank you and enjoy the Site.%26lt;/p%26gt;
?%26lt;p%26gt;
?%26lt;label%26gt;%26lt;br /%26gt;
?%26lt;/label%26gt;
?%26lt;a href=''http:///PrivacyNotice.html'' title=''Privacy Notice''%26gt;Privacy Notice%26lt;/a%26gt; and %26lt;a href=''http:///UserAgreement.html'' title=''User Agreeement''%26gt;User Agreement%26lt;/a%26gt;%26lt;br /%26gt;
?%26lt;br /%26gt;
?%26lt;a href=http://WEBSITE REMOVED FOR PRIVACY title=''ENTER''%26gt;ENTER HERE%26lt;/a%26gt;

?%26lt;br /%26gt;
?%26lt;/p%26gt;
?%26lt;/div%26gt;
?%26lt;/label%26gt;
%26lt;/form%26gt;
%26lt;script type=''text/javascript''%26gt;
%26lt;!--
var sprycheckbox1 = new Spry.Widget.ValidationCheckbox(''sprycheckbox1'');
var sprycheckbox2 = new Spry.Widget.ValidationCheckbox(''sprycheckbox2'');
//--%26gt;
%26lt;/script%26gt;
%26lt;/body%26gt;
%26lt;/html%26gt;

Spry Checkbox Not Locking Out 'Enter'...

Instead of a %26lt;a%26gt; element use a %26lt;input type=''submit'' value='''' /%26gt; or %26lt;button type=''submit''%26gt;%26lt;/button%26gt;

Spry Checkbox Not Locking Out 'Enter'...

So instead of this:

%26lt;a href=http://example.com title=''ENTER''%26gt;ENTER HERE%26lt;/a%26gt;

I would use this?

%26lt;button type=''submit''%26gt;

%26lt;a href=http://example.com title=''ENTER''%26gt;ENTER HERE%26lt;/a%26gt;

%26lt;/button%26gt;

?

Can you maybe put together that little bit of code below because I might be a little confused.?From the example in this thread, I am trying to use the ''ENTER HERE'' (the one that is underscored and boldface) as my link to my site.?In turn, clicking on that link will check to see that sprycheckbox1 and sprycheckbox2 are checked.?If they are not, then the link will not be active and they will have to checkmark both boxes to be acle to activate the ''ENTER HERE'' link.?Maybe i'm missing something here, I am a Dreamweaver Virgin here.

Thanks.

No comments:

Post a Comment