E
eXploDe
Hiya,
I am currently designing a new website & wish for users to read the
disclaimer, so I have used a script to call a code from a list. The
only problem is validating the code. Here is my current code:
<script language="JavaScript" type="text/javascript">
<!--
var photos = 9;
var now = new Date()
var sec = now.getSeconds()
var ad = sec % photos;
ad +=1;
if (ad==1) {
alt=3957;
}
if (ad==2) {
alt=2395;
}
if (ad==3) {
alt=2645;
}
if (ad==4) {
alt=1029;
}
if (ad==5) {
alt=2048;
}
if (ad==6) {
alt=9683;
}
if (ad==7) {
alt=3948;
}
if (ad==8) {
alt=1389;
}
if (ad==9) {
alt=3745;
}
document.write(' ' + alt + ' \ ');
}
// -->
</script>
<script language="JavaScript" type="text/javascript">
<!--
function valid(form) {
var field = form.age;
var userAge = parseInt(field.value);
if (!userAge = " + alt + ") {
alert("You must indicate your age.");
return false;
} else if (userAge = " + alt + ") {
return true;
} else {
alert("Incorrect Code. Please read Disclaimer");
field.focus();
field.select();
return false;
}
}
// --></script>
<FORM METHOD="GET"
ACTION="index-frameset.html"
ENCTYPE="text/plain"
onSubmit="return valid(this)">
Your age:<BR><INPUT TYPE="text" NAME="age" SIZE="2">
<INPUT TYPE="button" VALUE="Enter">
The Entry code is displayed elsewhere.
Hope someone understands my attempt,
Please either email a reply, or post a reply.
Thanks, Chris
I am currently designing a new website & wish for users to read the
disclaimer, so I have used a script to call a code from a list. The
only problem is validating the code. Here is my current code:
<script language="JavaScript" type="text/javascript">
<!--
var photos = 9;
var now = new Date()
var sec = now.getSeconds()
var ad = sec % photos;
ad +=1;
if (ad==1) {
alt=3957;
}
if (ad==2) {
alt=2395;
}
if (ad==3) {
alt=2645;
}
if (ad==4) {
alt=1029;
}
if (ad==5) {
alt=2048;
}
if (ad==6) {
alt=9683;
}
if (ad==7) {
alt=3948;
}
if (ad==8) {
alt=1389;
}
if (ad==9) {
alt=3745;
}
document.write(' ' + alt + ' \ ');
}
// -->
</script>
<script language="JavaScript" type="text/javascript">
<!--
function valid(form) {
var field = form.age;
var userAge = parseInt(field.value);
if (!userAge = " + alt + ") {
alert("You must indicate your age.");
return false;
} else if (userAge = " + alt + ") {
return true;
} else {
alert("Incorrect Code. Please read Disclaimer");
field.focus();
field.select();
return false;
}
}
// --></script>
<FORM METHOD="GET"
ACTION="index-frameset.html"
ENCTYPE="text/plain"
onSubmit="return valid(this)">
Your age:<BR><INPUT TYPE="text" NAME="age" SIZE="2">
<INPUT TYPE="button" VALUE="Enter">
The Entry code is displayed elsewhere.
Hope someone understands my attempt,
Please either email a reply, or post a reply.
Thanks, Chris