View Full Version : checkbox component
adamb70
07-23-2003, 01:29 PM
I have a flash form (attached) which I need to add a checkbox to.
The file can be seen at : http://www.jointhelist.com/heartfm/justina/justina.html
When I have tried to add a checkbox - called OptIn - a field is being created in the database but it the field is being populated with the correct data.
The text boxes are working fine.
I tried adding the check box and updating the submit for to include this. Am I missing anything?
I've now removed the checkbox so if anyone could help it would be appreciated.
Billy T
07-23-2003, 01:42 PM
try this
adamb70
07-24-2003, 05:46 AM
Thanks for that Billy - what do I have to change in the HTML file?
Billy T
07-24-2003, 06:05 AM
dunno...post the code
cheers
adamb70
07-24-2003, 06:40 AM
Heres the code - not sure what you need so heres all of it and its a bit messy.
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<HTML>
<HEAD>
<!-- Start of Non Flash redirect -->
<SCRIPT LANGUAGE=JavaScript1.1>
<!--
var MM_contentVersion = 5;
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if ( plugin ) {
var words = navigator.plugins["Shockwave Flash"].description.split(" ");
for (var i = 0; i < words.length; ++i)
{
if (isNaN(parseInt(words[i])))
continue;
var MM_PluginVersion = words[i];
}
var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
}
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0
&& (navigator.appVersion.indexOf("Win") != -1)) {
document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
document.write('on error resume next \n');
document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
document.write('</SCR' + 'IPT\> \n');
}
if ( !MM_FlashCanPlay ) {
window.location = "justina_noflash.html";
}
//-->
</SCRIPT>
<!-- End of Non Flash redirect -->
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<title>Justified and Stripped entry page</title>
<style type="text/css">
<!--
.BodyCopy { font-family: Arial, Helvetica, sans-serif; font-size: 14px; font-weight: bold; color: #FFFFFF}
.SmallerCopy { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-weight: normal; color: #FFFFCC}
.LegalCopy { font-family: Arial, Helvetica, sans-serif; font-size: 10px; color: #FFFFCC; font-weight: normal}
.VSmallCopy { font-family: Arial, Helvetica, sans-serif; color: #999999; font-size: 9px}
-->
</style>
<script language="javascript">
function EmailAlert(GetValue) {
if(GetValue=="") {
alert("Please enter your email address");
} else {
alert("Please enter a valid email address");
}
}
function SubmitThisForm(GetEmail,GetFriend1,GetFriend2,GetF riend3,GetOptIn) {
document.JoinForm.Email.value = GetEmail;
document.JoinForm.FriendEmail1.value = GetFriend1;
document.JoinForm.FriendEmail2.value = GetFriend2;
document.JoinForm.FriendEmail3.value = GetFriend3;
document.JoinForm.OptIn.value = GetOptIn;
document.JoinForm.submit();
}
</script>
</HEAD>
<BODY TEXT="#FFFFFF" BGCOLOR="#330066" LINK="#FFFF00" VLINK="#009900" ALINK="#FF0000">
<CENTER>
<span class="BodyCopy"></span>
<table width="600" border="0" cellpadding="0" cellspacing="0">
<tr align="center">
<td valign="top" height="20"><a name="Top"></a><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="600" height="440">
<param name="movie" value="http://www.jointhelist.com/heartfm/justina/justina.swf">
<param name="quality" value="high">
<param name="LOOP" value="false">
<embed src="http://www.jointhelist.com/heartfm/justina/justina.swf" width="600" height="440" loop="false" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash">
</embed>
</object></td>
</tr>
<tr align="center">
<td height="20" valign="top" class="LegalCopy">
<div align="left" class="VSmallCopy">If you can't see anything, <a href="http://www.jointhelist.com/heartfm/justina/justina_noflash.html">click
here</a></div>
</td>
</tr>
<tr align="center">
<td height="20" valign="top" class="VSmallCopy"> </td>
</tr>
<tr align="left">
<td valign="top" height="20" class="BodyCopy">
<p>Win tickets!</p>
<p class="SmallerCopy">On Sunday 17 August Justin Timberlake and Christina
Aguilera are bringing the 'Justified and Stripped Tour' to New York
and you and a friend could be there!</p>
<p class="SmallerCopy"><a name="PrizeDetails"></a>This fantastic prize
includes, return flights to New York, 3 nights accommodation at the
Hotel Metro in Manhattan, two tickets to see the 'Justified and Stripped
Tour', a limousine transfer from the hotel to the concert and $500 spending
money!</p>
<p class="SmallerCopy">For the chance to win, simply enter your details
on your exclusive ticket above - and don't forget, for every one of
your friends you tell, you'll receive an extra chance to win!</p>
<p class="SmallerCopy"><b>Tune into London's Heart 106.2 for More Music
Variety </b></p>
<p class="SmallerCopy"> </p>
</td>
</tr>
</table>
<table width="600" border="0" cellspacing="0" cellpadding="0" class="LegalCopy">
<tr>
<td colspan="2"><b class="BodyCopy">Contest Rules & Regulations</b></td>
</tr>
<tr>
<td width="14" class="LegalCopy"> </td>
<td width="586" class="LegalCopy"> </td>
</tr>
<tr>
<td width="14" class="LegalCopy" align="center" valign="top"></td>
<td width="586" class="LegalCopy"> The competition is not open to employees,
or members of their immediate families, of Heart 106.2, their agents,
participating clients or anyone connected with the promotion of the competition
or event and in the event of any dispute the decision of Heart 106.2 shall
be final and legally binding.</td>
</tr>
<tr>
<td width="14" class="LegalCopy" align="center" valign="top"></td>
<td width="586" class="LegalCopy"> Prize is non-changeable, non-transferable
and non-refundable either wholly or in part by cash.</td>
</tr>
<tr>
<td width="14" class="LegalCopy" align="center" valign="top"></td>
<td width="586" class="LegalCopy"> In the event of the stated prize becoming
unavailable Heart 106.2 will, where appropriate, arrange the supply of
an appropriate alternative of similar value at Heart 106.2's sole discretion.</td>
</tr>
<tr>
<td width="14" class="LegalCopy" align="center" valign="top"></td>
<td width="586" class="LegalCopy"> Offer only open to UK residents.</td>
</tr>
<tr>
<td width="14" class="LegalCopy" align="center" valign="top"></td>
<td width="586" class="LegalCopy"> The prize is based on return flights
for 2 adults from London to New York (outbound - depart Fri 15 Aug. Inbound
- arrive Tues 19 Aug), all taxes and security charges and airport transfers.
At least one winner must be over 18 years old.</td>
</tr>
<tr>
<td width="14" class="LegalCopy" align="center" valign="top"></td>
<td width="586" class="LegalCopy"> 3 nights' accommodation at Hotel Metro
in Manhattan based on sharing a twin/double room.</td>
</tr>
<tr>
<td width="14" class="LegalCopy" align="center" valign="top"></td>
<td width="586" class="LegalCopy"> Tickets to concert on Sun 17th Aug at
Nassau Coliseum, Long Island, New York state.</td>
</tr>
<tr>
<td width="14" class="LegalCopy" align="center" valign="top"></td>
<td width="586" class="LegalCopy"> Sedan limousine transfers from the hotel
to the concert in Long Island and back.</td>
</tr>
<tr>
<td width="14" class="LegalCopy" align="center" valign="top"></td>
<td width="586" class="LegalCopy"> Services of local representative in New
York.</td>
</tr>
<tr>
<td width="14" class="LegalCopy" align="center" valign="top"></td>
<td width="586" class="LegalCopy"> Travel insurance and $500 spending money.</td>
</tr>
<tr>
<td width="14" class="LegalCopy" align="center" valign="top"></td>
<td width="586" class="LegalCopy"> Any holiday cancelled will be subject
to the tour operator cancellation charges for which you will be liable.</td>
</tr>
<tr>
<td width="14" class="LegalCopy" align="center" valign="top"></td>
<td width="586" class="LegalCopy"> The insurance policy becomes invalid
if any of the party are travelling against the advice of a medical practitioner.</td>
</tr>
<tr>
<td width="14" class="LegalCopy" align="center" valign="top"></td>
<td width="586" class="LegalCopy"> The prize-winner must advise TFI Quest
Ltd of any recurring illnesses or on-going illnesses, or if anyone is
on a waiting list for inpatient treatment. This rule applies to anyone
upon whose health the trip may depend, whether they are travelling or
not</td>
</tr>
<tr>
<td width="14" class="LegalCopy" align="center" valign="top"></td>
<td width="586" class="LegalCopy"> Use of false name or address will result
in disqualification.</td>
</tr>
<tr>
<td width="14" class="LegalCopy" align="center" valign="top"></td>
<td width="586" class="LegalCopy"> All timings are approximate and subject
to change.</td>
</tr>
<tr>
<td width="14" class="LegalCopy" align="center" valign="top"></td>
<td width="586" class="LegalCopy"> There is no cash alternative to the prize.</td>
</tr>
<tr>
<td width="14" class="LegalCopy" align="center" valign="top"></td>
<td width="586" class="LegalCopy"> Closing date for entry is 28 July 2003
and winner will be picked at random and notified by telephone or in writing.</td>
</tr>
<tr>
<td width="14" class="LegalCopy" align="center" valign="top"></td>
<td width="586" class="LegalCopy"> Winners may be required to be photographed
for publicity purposes.</td>
</tr>
<tr>
<td width="14" class="LegalCopy" align="center" valign="top"></td>
<td width="586" class="LegalCopy">The Marketing Director's decisions on
all matters affecting this competition are final and no correspondence
will be entered into.</td>
</tr>
<tr>
<td width="14" class="LegalCopy" align="center" valign="top"></td>
<td width="586"> Entrants will be deemed to have accepted and agreed to
be bound by these <a href="http://www.heart1062.co.uk/winprizes.asp">Contest
Rules and Regulations</a>.</td>
</tr>
<tr>
<td width="14" class="LegalCopy" align="center" valign="top"></td>
<td width="586"> Supplying your email address will enable Heart 106.2fm
to contact you by email. Heart 106.2fm will not pass on your data to third
parties.</td>
</tr>
<tr>
<td width="14" class="LegalCopy" align="center" valign="top"> </td>
<td width="586" class="LegalCopy"> </td>
</tr>
<tr>
<td colspan="2" class="LegalCopy"><b><a href="http://www.heart1062.co.uk/winprizes.asp" target="_blank">Click
here</a> for our full terms and conditions and privacy policy</b></td>
</tr>
<tr>
<td colspan="2" class="LegalCopy"> </td>
</tr>
<tr>
<td colspan="2" class="LegalCopy"><a href="#Top">Back to top</a></td>
</tr>
</table>
<p> </p>
<p class="SmallerCopy"> </p>
<form action="http://www.jointhelist.com/cgi-bin/vjoinform.cgi" method="POST" name="JoinForm" onSubmit="return ValidateForm();" target="_parent">
<INPUT type="hidden" name="ReleaseID" value="heartjustina_v">
<INPUT type="hidden" name="PageName" value="http://www.jointhelist.com/heartfm/justina/justinarep.html">
<INPUT type="hidden" name="Email" value="">
<INPUT type="hidden" name="FriendEmail1" value="">
<INPUT type="hidden" name="FriendEmail2" value="">
<INPUT type="hidden" name="FriendEmail3" value="">
<INPUT type="hidden" name="OptIn" value="">
</form>
</CENTER>
</BODY>
</HTML>
Billy T
07-24-2003, 09:24 AM
ok I'm assuming that this is what gets called by the submit button
function SubmitThisForm(GetEmail,GetFriend1,GetFriend2,GetF riend3,GetOptIn) {
document.JoinForm.Email.value = GetEmail;
document.JoinForm.FriendEmail1.value = GetFriend1;
document.JoinForm.FriendEmail2.value = GetFriend2;
document.JoinForm.FriendEmail3.value = GetFriend3;
document.JoinForm.OptIn.value = GetOptIn;
document.JoinForm.submit();
}
so what happens when you hit submit?
post the relevant flash code too
cheers
adamb70
07-24-2003, 10:17 AM
what flash code do you need?
does this really have anything to do with flash???
this looks like your form:
<form action="http://www.jointhelist.com/cgi-bin/vjoinform.cgi" method="POST" name="JoinForm" onSubmit="return ValidateForm();" target="_parent">
<INPUT type="hidden" name="ReleaseID" value="heartjustina_v">
<INPUT type="hidden" name="PageName" value="http://www.jointhelist.com/heartfm/justina/justinarep.html">
<INPUT type="hidden" name="Email" value="">
<INPUT type="hidden" name="FriendEmail1" value="">
<INPUT type="hidden" name="FriendEmail2" value="">
<INPUT type="hidden" name="FriendEmail3" value="">
<INPUT type="hidden" name="OptIn" value="">
</form>
i don't see your function 'returnValidateForm()' anywhere in your script. for that matter i don't see a button to submit the form with.
i think maybe we need more info here.
adamb70
07-24-2003, 11:31 AM
Everything works fine but the check box doesn't. A field is being created in the database but its not being populated.
You'll have to bare with me here cos I'm really not techy at all!
Hope we can work it out!
Thanks for your time
the thing is i don't see a check box anywhere.... if your form fields are in flash, then you need to show us your fla.
adamb70
07-24-2003, 12:05 PM
This is the code for the submit button in the flash file :
on (press) {
if (!_root.ButtonPressed) {
if (Email.indexOf("@")<1) {
// getURL("javascript:EmailAlert('"+Email+"');");
trace(OptIn.getValue());
} else {
// getURL("javascript:SubmitThisForm('"+Email+"','"+FriendEmail1+"','"+FriendEmail2+"','"+FriendEmail3+"');");
_root.MoveOn();
_root.ButtonPressed = true;
}
}
}
OptIn being the checkbox added by Billy T.
Cheers
then shouldn't:
// getURL("javascript:SubmitThisForm('"+Email+"','"+FriendEmail1+"','"+FriendEmail2+"','"+FriendEmail3+"');");
be:
// getURL("javascript:SubmitThisForm('"+Email+"','"+FriendEmail1+"','"+FriendEmail2+"','"+FriendEmail3+","+OptIn.getValue()+"');");
doesn't look like your passing your checkbox value to your javascript.
dang... now that i used the [as] tags on your code, i see that you have those lines commented out.
well, can't help now... got a tufte seminar to go to, if someone hasn't helped you by the time i get back, i'll take another look.
Billy T
07-24-2003, 08:54 PM
not sure why it is commented out - the line that tg mentioned should be what you need
when you call a function you need to provide all the relevant parameters so make sure the value of the check box is being sent to the function
cheers
adamb70
07-25-2003, 06:11 AM
Cheers for your help chaps - I'll test it out and let you know how it goes.
Not sure why it was commented out either - It shouldnt have been so I've changed the code.
adamb70
07-28-2003, 12:45 PM
yeah - just got it done.
Thanks for your time mate.
Much relief!
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.