Login Form

#555 – Invalid token when creating a custom form

Posted in ‘BF Survey’
This is a public ticket. Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.
Thursday, 12 March 2015 02:58 AEDT
digitalsoul
Joomla! version: (no idea)

Hi there, I have created a custom form using the output data from a menu item linked to BF Survey.

http://projectstatus.co.in/carchaseheroes/component/content/article?id=36

The form is now in an article.

I noticed that the form uses validation and a code f.check.value='fa011c5e731b1c8bfa4705d890998e85'

&

<input type="hidden" name="fa011c5e731b1c8bfa4705d890998e85" value="1" aria-invalid="false"

Does this code change periodically? I don't want this code changing - as the form will not validate.

Is there a solution so that I don't get a 'white screen of death' with 'message invalid token'

Thanks in advance.
Steven
Thursday, 12 March 2015 17:02 AEDT 15'
Tim
Everything Bundle, BF Quiz Plus 3 Years, BF Survey 12 Months
Hi Steven,
The token on the form is a security feature in Joomla to prevent cross site request forgery (CSRF). Yes the token will change with each session, not sure why you are getting the invalid token message.

The token is generated by Joomla via the line of code near the bottom of the form:
<?php echo JHtml::_('form.token'); ?>

When the form is submitted, Joomla checks this via:
JSession::checkToken()
or something like:
JFactory::getSession()->getFormToken()


To troubleshoot why you are getting an invalid token, I'd need to take a look at your site. Feel free to make this a private ticket and provide login information. Please note that I'll be flying to China on Sunday for a week, so I might not have time to look into this until I get back.

regards

Tim
Follow us on twitter http://twitter.com/tamlynsoftware
Thursday, 12 March 2015 18:30 AEDT
digitalsoul
Hi thanks for your reply.

I have created a new form from the output of the original form created by a menu link to bf survey.

The code used has a session code in it that's not dynamic anymore.

This new form is standard html inside a Joomla article. The reason for this is to add images between tick box questions.

I couldn't find any other way to add images except using and changing raw code output from bf survey.

Is there any way to add images to bf survey template so that I don't have to use raw code inside joomla article.

Is there a template i can edit?

Thanks
Steven
Thursday, 12 March 2015 20:23 AEDT
digitalsoul
Basically I need to replace the validator token script in the following static HTML code with dynamic PHP script so that the form can dynamically input a new session code every time:

<div id="content-main" class="span12 pull-right">
<div class="gutter">





<!--
// get variable from php
var showName = "1";
var showCompany = "0";
var showEmail = "1";
var toggle = 1;
var othertoggle = 0;

function ToggleDetails(){
if(toggle == 1){
// hide details
if(showName=="1"){
document.getElementById("MyName").style.display = 'none';
document.getElementById("fullname").className = 'none';
document.getElementById("fullname").removeClass('invalid');
document.getElementById("fullname").set('aria-invalid', 'false');
document.getElementById("fullname").set('aria-required', 'false');
document.getElementById("fullname").set('required', '');
document.getElementById("fullname").set('disabled', 'disabled');
}

if(showCompany=="1"){
document.getElementById("MyCompany").style.display = 'none';
document.getElementById("company").className = 'none';
document.getElementById("company").removeClass('invalid');
document.getElementById("company").set('aria-invalid', 'false');
document.getElementById("company").set('aria-required', 'false');
document.getElementById("company").set('required', '');
document.getElementById("company").set('disabled', 'disabled');
}

if(showEmail=="1"){
document.getElementById("email").className = 'none';
document.getElementById("MyEmail").style.display = 'none';
document.getElementById("email").removeClass('invalid');
document.getElementById("email").set('aria-invalid', 'false');
document.getElementById("email").set('aria-required', 'false');
document.getElementById("email").set('required', '');
document.getElementById("email").set('disabled', 'disabled');
}
toggle=0;

}else{
// show details
if(showName=="1"){
document.getElementById("MyName").style.display = '';
document.getElementById("fullname").className = 'required';
document.getElementById("fullname").set('disabled', '');
}

if(showCompany=="1"){
document.getElementById("MyCompany").style.display = '';
document.getElementById("company").className = 'required';
document.getElementById("company").set('disabled', '');
}

if(showEmail=="1"){
document.getElementById("email").className = 'required validate-email';
document.getElementById("MyEmail").style.display = '';
document.getElementById("email").set('disabled', '');
}
toggle=1;
}
}

function MakeOtherMandatory(fieldname, z){
myid = fieldName + z +'_other';
if(othertoggle == 1){
// hide details
document.getElementById(myid).className = 'none';
othertoggle=0;
}else{
document.getElementById(myid).className = 'required';
othertoggle=1;
}
}

//-->







function myValidate(f) {
if (document.formvalidator.isValid(f)) {
f.check='';
f.check.value='fa011c5e731b1c8bfa4705d890998e85';//send token
return true;
}
else {
alert('Some values are not acceptable. Please retry.');
}
return false;
}
function imposeMaxLength(Event, Object, MaxLen)
{
return (Object.value.length <= MaxLen)||(Event.keyCode == 8 ||Event.keyCode==46||(Event.keyCode>=35&&Event.keyCode<=40));
}



<form method="POST" name="survey" id="survey" class="form-validate" >

<input type="hidden" name="catid" value="11" aria-invalid="false">
<input type="hidden" name="table" value="#__bfsurveyplus_11" aria-invalid="false">
<input type="hidden" name="preventMultipleEmail" value="0" aria-invalid="false">

<table width="100%" cellspacing="0">
<thead>
<tr>
<th>
<div class="bfsurvey_plusTitle">Car Chase Heroes Competition</div>
</th>
</tr>
</thead>

<tbody><tr>
<td>
<div class="bfsurvey_plusIntro">
So you want to win a FREE Car Chase Day!

Then select the cars you would most like to experience driving in order. Complete the form below and be entered into our prize draw!

The voucher is worth £99 to spend on a 1 day Car Chase Hero experience!

Please note 1 winner in every 100 forms completed. </div>
<div class="bfsurvey_plusQuestionFooter">
</div>
</td>
</tr>

<tr>
<th>
</th>
</tr>

<tr>
<th>
<div id="MyName">
<table>
<tbody><tr>
<td width="70">
<div class="BFSurveyCustomerQuestion">
Name </div>
</td>
<td>
<div class="BFSurveyCustomerOptions">
<input name="fullname" id="fullname" size="55" class="required invalid" value="" aria-required="true" required="required" aria-invalid="true">
</div>
</td>
</tr>
</tbody></table>
</div>
</th>
</tr>


<tr>
<th>
<div id="MyEmail">
<table>
<tbody><tr>
<td width="70">
<div class="BFSurveyCustomerQuestion">
Email </div>
</td>
<td>
<div class="BFSurveyCustomerOptions">
<input name="email" id="email" size="55" class="required validate-email invalid" value="" aria-required="true" required="required" type="email" aria-invalid="true">
</div>
</td>
</tr>
</tbody></table>
</div>
</th>
</tr>

<tr>
<td>
</td>
</tr>



<input id="field_name" name="field_name" type="hidden" value="question_one" aria-invalid="false">

<tr>
<th>
<div class="bfsurvey_plusQuestion">What car would be your FIRST choice?</div>
</th>
</tr>
<tr class="bfsurvey_plusTableRow">
<th>
<div class="bfsurvey_plusOptions">

<label for="question_one0" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_1.png" /><br /><input type="checkbox" name="question_one[]" value="Chevrolet Camaro ZL1 ‘Bumblebee’" id="question_one0" aria-invalid="false">Chevrolet Camaro ZL1 ‘Bumblebee’</label>

    <label for="question_one1" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_2.png" /><br /><input type="checkbox" name="question_one[]" value="NASCAR from Days of Thunder" id="question_one1" aria-invalid="false">NASCAR from Days of Thunder</label>

    <label for="question_one2" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_3.png" /><br /><input type="checkbox" name="question_one[]" value="Dodge Charger ‘General Lee’" id="question_one2" aria-invalid="false">Dodge Charger ‘General Lee’</label>

    <label for="question_one3" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/ac_cobra.png" /><br /><input type="checkbox" name="question_one[]" value="AC Cobra" id="question_one3" aria-invalid="false">AC Cobra</label>

    <label for="question_one4" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_4.png" /><br /><input type="checkbox" name="question_one[]" value="Starsky and Hutch Ford Gran Torino" id="question_one4" aria-invalid="false">Starsky and Hutch Ford Gran Torino</label>

    <label for="question_one5" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_15.png" /><br /><input type="checkbox" name="question_one[]" value="Fast and Furious Dodge Charger" id="question_one5" aria-invalid="false">Fast and Furious Dodge Charger</label>

    <label for="question_one6" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_6.png" /><br /><input type="checkbox" name="question_one[]" value="Fast and Furious Nissan Skyline" id="question_one6" aria-invalid="false">Fast and Furious Nissan Skyline</label>

    <label for="question_one7" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_10.png" /><br /><input type="checkbox" name="question_one[]" value="‘Eleanor’ Ford Mustang GT500" id="question_one7" aria-invalid="false">‘Eleanor’ Ford Mustang GT500</label>

    <label for="question_one8" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_9.png" /><br /><input type="checkbox" name="question_one[]" value="’66 Chevrolet Camaro SS" id="question_one8" aria-invalid="false">’66 Chevrolet Camaro SS</label>

    <label for="question_one9" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_12.png" /><br /><input type="checkbox" name="question_one[]" value="1997 Reynard Champ Car" id="question_one9" aria-invalid="false">1997 Reynard Champ Car</label>

    <label for="question_one10" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_16.png" /><br /><input type="checkbox" name="question_one[]" value="VW Beetle ‘Herbie’" id="question_one10" aria-invalid="false">VW Beetle ‘Herbie’</label>

    <label for="question_one11" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_17.png" /><br /><input type="checkbox" name="question_one[]" value="James Bond Aston DBS" id="question_one11" aria-invalid="false">James Bond Aston DBS</label>

    <label for="question_one12" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_18.png" /><br /><input type="checkbox" name="question_one[]" value="James Bond Jaguar XKR" id="question_one12" aria-invalid="false">James Bond Jaguar XKR</label>

    <label for="question_one13" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_19.png" /><br /><input type="checkbox" name="question_one[]" value="Original Mini Cooper" id="question_one13" aria-invalid="false">Original Mini Cooper</label>

    <label for="question_one14" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_20.png" /><br /><input type="checkbox" name="question_one[]" value="Batmobile" id="question_one14" aria-invalid="false">Batmobile</label>

    <label for="question_one15" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_21.png" /><br /><input type="checkbox" name="question_one[]" value="‘Bullitt’ Mustang" id="question_one15" aria-invalid="false">‘Bullitt’ Mustang</label>

    <label for="question_one16" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_8.png" /><br /><input type="checkbox" name="question_one[]" value="Lightning McQueen" id="question_one16" aria-invalid="false">Lightning McQueen</label>

    <label for="question_one17" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_11.png" /><br /><input type="checkbox" name="question_one[]" value="Corvette Race Car" id="question_one17" aria-invalid="false">Corvette Race Car</label>

    <label for="question_one18" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_13.png" /><br /><input type="checkbox" name="question_one[]" value="Mustang Police car" id="question_one18" aria-invalid="false">Mustang Police car</label>

    <label for="question_one19" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_22.png" /><br /><input type="checkbox" name="question_one[]" value="Delorian from Back to the Future" id="question_one19" aria-invalid="false">Delorian from Back to the Future</label>

   <input type="hidden" name="question1" value="9" aria-invalid="false"><input type="hidden" name="question_type1" value="2" aria-invalid="false"> </div>
<div class="bfsurvey_plusQuestionFooter">

</div>
</th>
</tr>


<input id="field_name" name="field_name" type="hidden" value="question_one_9" aria-invalid="false">

<tr>
<th>
<div class="bfsurvey_plusQuestion">What car would be your SECOND choice?</div>
</th>
</tr>
<tr class="bfsurvey_plusTableRow">
<th>
<div class="bfsurvey_plusOptions">

<label for="question_one_90" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_1.png" /><br /><input type="checkbox" name="question_one_9[]" value="Chevrolet Camaro ZL1 ‘Bumblebee’" id="question_one_90" aria-invalid="false">Chevrolet Camaro ZL1 ‘Bumblebee’</label>

    <label for="question_one_91" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_2.png" /><br /><input type="checkbox" name="question_one_9[]" value="NASCAR from Days of Thunder" id="question_one_91" aria-invalid="false">NASCAR from Days of Thunder</label>

    <label for="question_one_92" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_3.png" /><br /><input type="checkbox" name="question_one_9[]" value="Dodge Charger ‘General Lee’" id="question_one_92" aria-invalid="false">Dodge Charger ‘General Lee’</label>

    <label for="question_one_93" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/ac_cobra.png" /><br /><input type="checkbox" name="question_one_9[]" value="AC Cobra" id="question_one_93" aria-invalid="false">AC Cobra</label>

    <label for="question_one_94" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_4.png" /><br /><input type="checkbox" name="question_one_9[]" value="Starsky and Hutch Ford Gran Torino" id="question_one_94" aria-invalid="false">Starsky and Hutch Ford Gran Torino</label>

    <label for="question_one_95" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_15.png" /><br /><input type="checkbox" name="question_one_9[]" value="Fast and Furious Dodge Charger" id="question_one_95" aria-invalid="false">Fast and Furious Dodge Charger</label>

    <label for="question_one_96" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_6.png" /><br /><input type="checkbox" name="question_one_9[]" value="Fast and Furious Nissan Skyline" id="question_one_96" aria-invalid="false">Fast and Furious Nissan Skyline</label>

    <label for="question_one_97" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_10.png" /><br /><input type="checkbox" name="question_one_9[]" value="‘Eleanor’ Ford Mustang GT500" id="question_one_97" aria-invalid="false">‘Eleanor’ Ford Mustang GT500</label>

    <label for="question_one_98" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_9.png" /><br /><input type="checkbox" name="question_one_9[]" value="’66 Chevrolet Camaro SS" id="question_one_98" aria-invalid="false">’66 Chevrolet Camaro SS</label>

    <label for="question_one_99" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_12.png" /><br /><input type="checkbox" name="question_one_9[]" value="1997 Reynard Champ Car" id="question_one_99" aria-invalid="false">1997 Reynard Champ Car</label>

    <label for="question_one_910" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_16.png" /><br /><input type="checkbox" name="question_one_9[]" value="VW Beetle ‘Herbie’" id="question_one_910" aria-invalid="false">VW Beetle ‘Herbie’</label>

    <label for="question_one_911" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_17.png" /><br /><input type="checkbox" name="question_one_9[]" value="James Bond Aston DBS" id="question_one_911" aria-invalid="false">James Bond Aston DBS</label>

    <label for="question_one_912" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_18.png" /><br /><input type="checkbox" name="question_one_9[]" value="James Bond Jaguar XKR" id="question_one_912" aria-invalid="false">James Bond Jaguar XKR</label>

    <label for="question_one_913" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_19.png" /><br /><input type="checkbox" name="question_one_9[]" value="Original Mini Cooper" id="question_one_913" aria-invalid="false">Original Mini Cooper</label>

    <label for="question_one_914" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_20.png" /><br /><input type="checkbox" name="question_one_9[]" value="Batmobile" id="question_one_914" aria-invalid="false">Batmobile</label>

    <label for="question_one_915" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_21.png" /><br /><input type="checkbox" name="question_one_9[]" value="‘Bullitt’ Mustang" id="question_one_915" aria-invalid="false">‘Bullitt’ Mustang</label>

    <label for="question_one_916" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_8.png" /><br /><input type="checkbox" name="question_one_9[]" value="Lightning McQueen" id="question_one_916" aria-invalid="false">Lightning McQueen</label>

    <label for="question_one_917" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_11.png" /><br /><input type="checkbox" name="question_one_9[]" value="Corvette Race Car" id="question_one_917" aria-invalid="false">Corvette Race Car</label>

    <label for="question_one_918" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_13.png" /><br /><input type="checkbox" name="question_one_9[]" value="Mustang Police car" id="question_one_918" aria-invalid="false">Mustang Police car</label>

    <label for="question_one_919" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_22.png" /><br /><input type="checkbox" name="question_one_9[]" value="Delorian from Back to the Future" id="question_one_919" aria-invalid="false">Delorian from Back to the Future</label>

   <input type="hidden" name="question2" value="10" aria-invalid="false"><input type="hidden" name="question_type2" value="2" aria-invalid="false"> </div>
<div class="bfsurvey_plusQuestionFooter">

</div>
</th>
</tr>


<input id="field_name" name="field_name" type="hidden" value="question_one_9_10" aria-invalid="false">

<tr>
<th>
<div class="bfsurvey_plusQuestion">What car would be your THIRD choice?</div>
</th>
</tr>
<tr class="bfsurvey_plusTableRow">
<th>
<div class="bfsurvey_plusOptions">

<label for="question_one_9_100" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_1.png" /><br /><input type="checkbox" name="question_one_9_10[]" value="Chevrolet Camaro ZL1 ‘Bumblebee’" id="question_one_9_100" aria-invalid="false">Chevrolet Camaro ZL1 ‘Bumblebee’</label>

    <label for="question_one_9_101" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_2.png" /><br /><input type="checkbox" name="question_one_9_10[]" value="NASCAR from Days of Thunder" id="question_one_9_101" aria-invalid="false">NASCAR from Days of Thunder</label>

    <label for="question_one_9_102" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_3.png" /><br /><input type="checkbox" name="question_one_9_10[]" value="Dodge Charger ‘General Lee’" id="question_one_9_102" aria-invalid="false">Dodge Charger ‘General Lee’</label>

    <label for="question_one_9_103" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/ac_cobra.png" /><br /><input type="checkbox" name="question_one_9_10[]" value="AC Cobra" id="question_one_9_103" aria-invalid="false">AC Cobra</label>

    <label for="question_one_9_104" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_4.png" /><br /><input type="checkbox" name="question_one_9_10[]" value="Starsky and Hutch Ford Gran Torino" id="question_one_9_104" aria-invalid="false">Starsky and Hutch Ford Gran Torino</label>

    <label for="question_one_9_105" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_15.png" /><br /><input type="checkbox" name="question_one_9_10[]" value="Fast and Furious Dodge Charger" id="question_one_9_105" aria-invalid="false">Fast and Furious Dodge Charger</label>

    <label for="question_one_9_106" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_6.png" /><br /><input type="checkbox" name="question_one_9_10[]" value="Fast and Furious Nissan Skyline" id="question_one_9_106" aria-invalid="false">Fast and Furious Nissan Skyline</label>

    <label for="question_one_9_107" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_10.png" /><br /><input type="checkbox" name="question_one_9_10[]" value="‘Eleanor’ Ford Mustang GT500" id="question_one_9_107" aria-invalid="false">‘Eleanor’ Ford Mustang GT500</label>

    <label for="question_one_9_108" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_9.png" /><br /><input type="checkbox" name="question_one_9_10[]" value="’66 Chevrolet Camaro SS" id="question_one_9_108" aria-invalid="false">’66 Chevrolet Camaro SS</label>

    <label for="question_one_9_109" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_12.png" /><br /><input type="checkbox" name="question_one_9_10[]" value="1997 Reynard Champ Car" id="question_one_9_109" aria-invalid="false">1997 Reynard Champ Car</label>

    <label for="question_one_9_1010" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_16.png" /><br /><input type="checkbox" name="question_one_9_10[]" value="VW Beetle ‘Herbie’" id="question_one_9_1010" aria-invalid="false">VW Beetle ‘Herbie’</label>

    <label for="question_one_9_1011" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_17.png" /><br /><input type="checkbox" name="question_one_9_10[]" value="James Bond Aston DBS" id="question_one_9_1011" aria-invalid="false">James Bond Aston DBS</label>

    <label for="question_one_9_1012" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_18.png" /><br /><input type="checkbox" name="question_one_9_10[]" value="James Bond Jaguar XKR" id="question_one_9_1012" aria-invalid="false">James Bond Jaguar XKR</label>

    <label for="question_one_9_1013" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_19.png" /><br /><input type="checkbox" name="question_one_9_10[]" value="Original Mini Cooper" id="question_one_9_1013" aria-invalid="false">Original Mini Cooper</label>

    <label for="question_one_9_1014" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_20.png" /><br /><input type="checkbox" name="question_one_9_10[]" value="Batmobile" id="question_one_9_1014" aria-invalid="false">Batmobile</label>

    <label for="question_one_9_1015" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_21.png" /><br /><input type="checkbox" name="question_one_9_10[]" value="‘Bullitt’ Mustang" id="question_one_9_1015" aria-invalid="false">‘Bullitt’ Mustang</label>

    <label for="question_one_9_1016" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_8.png" /><br /><input type="checkbox" name="question_one_9_10[]" value="Lightning McQueen" id="question_one_9_1016" aria-invalid="false">Lightning McQueen</label>

    <label for="question_one_9_1017" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_11.png" /><br /><input type="checkbox" name="question_one_9_10[]" value="Corvette Race Car" id="question_one_9_1017" aria-invalid="false">Corvette Race Car</label>

    <label for="question_one_9_1018" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_13.png" /><br /><input type="checkbox" name="question_one_9_10[]" value="Mustang Police car" id="question_one_9_1018" aria-invalid="false">Mustang Police car</label>

    <label for="question_one_9_1019" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_22.png" /><br /><input type="checkbox" name="question_one_9_10[]" value="Delorian from Back to the Future" id="question_one_9_1019" aria-invalid="false">Delorian from Back to the Future</label>

   <input type="hidden" name="question3" value="11" aria-invalid="false"><input type="hidden" name="question_type3" value="2" aria-invalid="false"> </div>
<div class="bfsurvey_plusQuestionFooter">

</div>
</th>
</tr>


<input id="field_name" name="field_name" type="hidden" value="question_one_9_10_11" aria-invalid="false">

<tr>
<th>
<div class="bfsurvey_plusQuestion">What car would be your FOURTH choice?</div>
</th>
</tr>
<tr class="bfsurvey_plusTableRow">
<th>
<div class="bfsurvey_plusOptions">

<label for="question_one_9_10_110" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_1.png" /><br /><input type="checkbox" name="question_one_9_10_11[]" value="Chevrolet Camaro ZL1 ‘Bumblebee’" id="question_one_9_10_110" aria-invalid="false">Chevrolet Camaro ZL1 ‘Bumblebee’</label>

    <label for="question_one_9_10_111" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_2.png" /><br /><input type="checkbox" name="question_one_9_10_11[]" value="NASCAR from Days of Thunder" id="question_one_9_10_111" aria-invalid="false">NASCAR from Days of Thunder</label>

    <label for="question_one_9_10_112" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_3.png" /><br /><input type="checkbox" name="question_one_9_10_11[]" value="Dodge Charger ‘General Lee’" id="question_one_9_10_112" aria-invalid="false">Dodge Charger ‘General Lee’</label>

    <label for="question_one_9_10_113" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/ac_cobra.png" /><br /><input type="checkbox" name="question_one_9_10_11[]" value="AC Cobra" id="question_one_9_10_113" aria-invalid="false">AC Cobra</label>

    <label for="question_one_9_10_114" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_4.png" /><br /><input type="checkbox" name="question_one_9_10_11[]" value="Starsky and Hutch Ford Gran Torino" id="question_one_9_10_114" aria-invalid="false">Starsky and Hutch Ford Gran Torino</label>

    <label for="question_one_9_10_115" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_15.png" /><br /><input type="checkbox" name="question_one_9_10_11[]" value="Fast and Furious Dodge Charger" id="question_one_9_10_115" aria-invalid="false">Fast and Furious Dodge Charger</label>

    <label for="question_one_9_10_116" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_6.png" /><br /><input type="checkbox" name="question_one_9_10_11[]" value="Fast and Furious Nissan Skyline" id="question_one_9_10_116" aria-invalid="false">Fast and Furious Nissan Skyline</label>

    <label for="question_one_9_10_117" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_10.png" /><br /><input type="checkbox" name="question_one_9_10_11[]" value="‘Eleanor’ Ford Mustang GT500" id="question_one_9_10_117" aria-invalid="false">‘Eleanor’ Ford Mustang GT500</label>

    <label for="question_one_9_10_118" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_9.png" /><br /><input type="checkbox" name="question_one_9_10_11[]" value="’66 Chevrolet Camaro SS" id="question_one_9_10_118" aria-invalid="false">’66 Chevrolet Camaro SS</label>

    <label for="question_one_9_10_119" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_12.png" /><br /><input type="checkbox" name="question_one_9_10_11[]" value="1997 Reynard Champ Car" id="question_one_9_10_119" aria-invalid="false">1997 Reynard Champ Car</label>

    <label for="question_one_9_10_1110" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_16.png" /><br /><input type="checkbox" name="question_one_9_10_11[]" value="VW Beetle ‘Herbie’" id="question_one_9_10_1110" aria-invalid="false">VW Beetle ‘Herbie’</label>

    <label for="question_one_9_10_1111" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_17.png" /><br /><input type="checkbox" name="question_one_9_10_11[]" value="James Bond Aston DBS" id="question_one_9_10_1111" aria-invalid="false">James Bond Aston DBS</label>

    <label for="question_one_9_10_1112" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_18.png" /><br /><input type="checkbox" name="question_one_9_10_11[]" value="James Bond Jaguar XKR" id="question_one_9_10_1112" aria-invalid="false">James Bond Jaguar XKR</label>

    <label for="question_one_9_10_1113" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_19.png" /><br /><input type="checkbox" name="question_one_9_10_11[]" value="Original Mini Cooper" id="question_one_9_10_1113" aria-invalid="false">Original Mini Cooper</label>

    <label for="question_one_9_10_1114" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_20.png" /><br /><input type="checkbox" name="question_one_9_10_11[]" value="Batmobile" id="question_one_9_10_1114" aria-invalid="false">Batmobile</label>

    <label for="question_one_9_10_1115" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_21.png" /><br /><input type="checkbox" name="question_one_9_10_11[]" value="‘Bullitt’ Mustang" id="question_one_9_10_1115" aria-invalid="false">‘Bullitt’ Mustang</label>

    <label for="question_one_9_10_1116" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_8.png" /><br /><input type="checkbox" name="question_one_9_10_11[]" value="Lightning McQueen" id="question_one_9_10_1116" aria-invalid="false">Lightning McQueen</label>

    <label for="question_one_9_10_1117" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_11.png" /><br /><input type="checkbox" name="question_one_9_10_11[]" value="Corvette Race Car" id="question_one_9_10_1117" aria-invalid="false">Corvette Race Car</label>

    <label for="question_one_9_10_1118" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_13.png" /><br /><input type="checkbox" name="question_one_9_10_11[]" value="Mustang Police car" id="question_one_9_10_1118" aria-invalid="false">Mustang Police car</label>

    <label for="question_one_9_10_1119" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_22.png" /><br /><input type="checkbox" name="question_one_9_10_11[]" value="Delorian from Back to the Future" id="question_one_9_10_1119" aria-invalid="false">Delorian from Back to the Future</label>

   <input type="hidden" name="question4" value="12" aria-invalid="false"><input type="hidden" name="question_type4" value="2" aria-invalid="false"> </div>
<div class="bfsurvey_plusQuestionFooter">

</div>
</th>
</tr>


<input id="field_name" name="field_name" type="hidden" value="question_one_9_10_11_12" aria-invalid="false">

<tr>
<th>
<div class="bfsurvey_plusQuestion">What car would be your FIFTH choice?</div>
</th>
</tr>
<tr class="bfsurvey_plusTableRow">
<th>
<div class="bfsurvey_plusOptions">

<label for="question_one_9_10_11_120" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_1.png" /><br /><input type="checkbox" name="question_one_9_10_11_12[]" value="Chevrolet Camaro ZL1 ‘Bumblebee’" id="question_one_9_10_11_120" aria-invalid="false">Chevrolet Camaro ZL1 ‘Bumblebee’</label>

    <label for="question_one_9_10_11_121" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_2.png" /><br /><input type="checkbox" name="question_one_9_10_11_12[]" value="NASCAR from Days of Thunder" id="question_one_9_10_11_121" aria-invalid="false">NASCAR from Days of Thunder</label>

    <label for="question_one_9_10_11_122" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_3.png" /><br /><input type="checkbox" name="question_one_9_10_11_12[]" value="Dodge Charger ‘General Lee’" id="question_one_9_10_11_122" aria-invalid="false">Dodge Charger ‘General Lee’</label>

    <label for="question_one_9_10_11_123" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/ac_cobra.png" /><br /><input type="checkbox" name="question_one_9_10_11_12[]" value="AC Cobra" id="question_one_9_10_11_123" aria-invalid="false">AC Cobra</label>

    <label for="question_one_9_10_11_124" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_4.png" /><br /><input type="checkbox" name="question_one_9_10_11_12[]" value="Starsky and Hutch Ford Gran Torino" id="question_one_9_10_11_124" aria-invalid="false">Starsky and Hutch Ford Gran Torino</label>

    <label for="question_one_9_10_11_125" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_15.png" /><br /><input type="checkbox" name="question_one_9_10_11_12[]" value="Fast and Furious Dodge Charger" id="question_one_9_10_11_125" aria-invalid="false">Fast and Furious Dodge Charger</label>

    <label for="question_one_9_10_11_126" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_6.png" /><br /><input type="checkbox" name="question_one_9_10_11_12[]" value="Fast and Furious Nissan Skyline" id="question_one_9_10_11_126" aria-invalid="false">Fast and Furious Nissan Skyline</label>

    <label for="question_one_9_10_11_127" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_10.png" /><br /><input type="checkbox" name="question_one_9_10_11_12[]" value="‘Eleanor’ Ford Mustang GT500" id="question_one_9_10_11_127" aria-invalid="false">‘Eleanor’ Ford Mustang GT500</label>

    <label for="question_one_9_10_11_128" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_9.png" /><br /><input type="checkbox" name="question_one_9_10_11_12[]" value="’66 Chevrolet Camaro SS" id="question_one_9_10_11_128" aria-invalid="false">’66 Chevrolet Camaro SS</label>

    <label for="question_one_9_10_11_129" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_12.png" /><br /><input type="checkbox" name="question_one_9_10_11_12[]" value="1997 Reynard Champ Car" id="question_one_9_10_11_129" aria-invalid="false">1997 Reynard Champ Car</label>

    <label for="question_one_9_10_11_1210" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_16.png" /><br /><input type="checkbox" name="question_one_9_10_11_12[]" value="VW Beetle ‘Herbie’" id="question_one_9_10_11_1210" aria-invalid="false">VW Beetle ‘Herbie’</label>

    <label for="question_one_9_10_11_1211" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_17.png" /><br /><input type="checkbox" name="question_one_9_10_11_12[]" value="James Bond Aston DBS" id="question_one_9_10_11_1211" aria-invalid="false">James Bond Aston DBS</label>

    <label for="question_one_9_10_11_1212" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_18.png" /><br /><input type="checkbox" name="question_one_9_10_11_12[]" value="James Bond Jaguar XKR" id="question_one_9_10_11_1212" aria-invalid="false">James Bond Jaguar XKR</label>

    <label for="question_one_9_10_11_1213" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_19.png" /><br /><input type="checkbox" name="question_one_9_10_11_12[]" value="Original Mini Cooper" id="question_one_9_10_11_1213" aria-invalid="false">Original Mini Cooper</label>

    <label for="question_one_9_10_11_1214" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_20.png" /><br /><input type="checkbox" name="question_one_9_10_11_12[]" value="Batmobile" id="question_one_9_10_11_1214" aria-invalid="false">Batmobile</label>

    <label for="question_one_9_10_11_1215" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_21.png" /><br /><input type="checkbox" name="question_one_9_10_11_12[]" value="‘Bullitt’ Mustang" id="question_one_9_10_11_1215" aria-invalid="false">‘Bullitt’ Mustang</label>

    <label for="question_one_9_10_11_1216" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_8.png" /><br /><input type="checkbox" name="question_one_9_10_11_12[]" value="Lightning McQueen" id="question_one_9_10_11_1216" aria-invalid="false">Lightning McQueen</label>

    <label for="question_one_9_10_11_1217" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_11.png" /><br /><input type="checkbox" name="question_one_9_10_11_12[]" value="Corvette Race Car" id="question_one_9_10_11_1217" aria-invalid="false">Corvette Race Car</label>

    <label for="question_one_9_10_11_1218" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_13.png" /><br /><input type="checkbox" name="question_one_9_10_11_12[]" value="Mustang Police car" id="question_one_9_10_11_1218" aria-invalid="false">Mustang Police car</label>

    <label for="question_one_9_10_11_1219" class="bfradiohorizontal" aria-invalid="false"><img class="comp" src="/images/interface/cars_22.png" /><br /><input type="checkbox" name="question_one_9_10_11_12[]" value="Delorian from Back to the Future" id="question_one_9_10_11_1219" aria-invalid="false">Delorian from Back to the Future</label>

   <input type="hidden" name="question5" value="13" aria-invalid="false"><input type="hidden" name="question_type5" value="2" aria-invalid="false"> </div>
<div class="bfsurvey_plusQuestionFooter">

</div>
</th>
</tr>
</tbody></table>


<input type="hidden" name="num" value="5" aria-invalid="false">
<input type="hidden" name="option" value="com_bfsurvey_plus" aria-invalid="false">
<input type="hidden" name="catid" value="11" aria-invalid="false">
<input type="hidden" name="Itemid" value="0" aria-invalid="false">
<input type="hidden" name="task" value="updateOnePage" aria-invalid="false">
<input type="hidden" name="redirectURL" value="index.php?option=com_content&view=article&id=37" aria-invalid="true">
<input type="hidden" name="allowEmail" value="1" aria-invalid="false">
<input type="hidden" name="showReferenceNo" value="0" aria-invalid="false">
<input type="submit" name="task_button" class="button" value="Next" aria-invalid="false">
<input type="hidden" name="fa011c5e731b1c8bfa4705d890998e85" value="1" aria-invalid="false"></form>




</div>
</div>
Thursday, 12 March 2015 20:27 AEDT
digitalsoul
I was looking for existing PHP script in BF Survey files to replace the static token code, but couldn't find any.

I would greatly appreciate if you tell me the PHP token script code to replace the static token script so that sessions are validated.

Thanks in advance.
Thursday, 12 March 2015 21:22 AEDT 5'
Tim
Everything Bundle, BF Quiz Plus 3 Years, BF Survey 12 Months
Ok, so you are using BF Survey Plus not BF Survey version 2 as I was thinking. In that case, for the all questions on one page view you could edit /components/com_bfsurvey_plus/controller.php

//line 365
JRequest::checkToken() or jexit( JText::_( 'COM_BFSURVEYPLUS_ERROR_INVALID_TOKEN') );

Just delete or comment out this line, and that will avoid all the token checking for your survey.

If you were using BF Survey version 2, I was going to suggest using the survey module, and using a third party extension such as modules anywhere to insert the survey into an article. Note that a subscription to BF Survey includes both BF Survey Plus and BF Survey version 2.

regards

Tim
Follow us on twitter http://twitter.com/tamlynsoftware
This ticket is closed, therefore read-only. You can no longer reply to it. If you need to provide more information, please open a new ticket and mention this ticket's number.
Go to top