Bienvenido, Invitado
Recordarme

TEMA:

Form for personality profile, calculation 2 años 6 meses antes #230798

  • Autor del tema
  • Webmarketingtrento
  • Fuera de línea
  • Fresh Breezer
  • Fresh Breezer
  • Mensajes: 15
  • Gracias recibidas: 0
Hi, I would like to create a form with 7 questions with 5 response options to which a personality is combined. For each personality then answer I gave a score Exemple:

What movie are you watching?

- Mad Max value 1 (relaxed)
- film 2 value 2 (cuddly)
- film 3 value 3 (extrovert)
- film 3 value 4 (intellectual)
- film 3 value 5 (sports)

Where would you go on vacation?
- use value 3 (extrovert)
- india value 5 (sports)
- europe value 2 (cuddly)

etc. etc

At the end add the score of the selections made and based on the total check if it falls within certain ranges redirect to a content page with a certain profile.

Looking in the forum I found this: crosstec.org/en/forums/1-forums/116725-q...nswers.html?start=18

that helps me in the first part to calculate the total, but how can I check to figure out which range of numbers falls (between 1 to 10 = relaxed) and direct the user to the specific page?

Thank you

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

Form for personality profile, calculation 2 años 6 meses antes #230811

  • mihaela
  • Fuera de línea
  • Developer
  • Developer
  • Mensajes: 3128
  • Karma: 105
  • Gracias recibidas: 415
Hello,

Here is a piece of documentation crosstec.org/en/support/online-documenta...-on-select-list.html that will help you to redirect a user depending on the total field.
That example is for select list, but it is the same for the textfiled total. You'll just have to add different conditions corresponding to how you would like this to work.
Your could should look similar to this:
$this->execPieceByName('ff_InitLib');
$value = ff_getSubmit('totalfieldname');
if( ($value >=1) && ($value <=10) ) { header('Location: http://crosstec.org'); exit; }
else if (....)  { header('Location:http://crosstec.org/forums.html'); exit;}
etc.

Regards,

Mihaela

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

Form for personality profile, calculation 2 años 6 meses antes #230815

  • mihaela
  • Fuera de línea
  • Developer
  • Developer
  • Mensajes: 3128
  • Karma: 105
  • Gracias recibidas: 415
I see now that you also want to know how you can check which range of number the total falls into.
Here is how you can check this by adding code to the script suggested in this topic crosstec.org/en/forums/1-forums/116725-q...answers.html?start=0 .

You should replace this line of code:
ff_getElementByName('sum').value = total;
with this code:
if(Number(total) >= 0 && Number(total) <= 10) { ff_getElementByName('sum').value ='relaxed' }
else if(Number(total) >= 11 && Number(total) <= 20) { ff_getElementByName('sum').value ='cuddly' }
elseif( ...)  {...}
This will put the result in the sum field.
If you use this solution, then the End submit pieces script from the previous post has to look similar to this:
$this->execPieceByName('ff_InitLib');
$value = ff_getSubmit('totalfieldname');
switch( $value )
{
     case 'relaxed': header('Location: http://crosstec.org'); exit;break;
     case 'cuddly': header('Location:http://crosstec.org/forums.html'); exit; break;
     etc.
}

Let me know whether this works as you wanted.

Regards,

Mihaela

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

Form for personality profile, calculation 2 años 6 meses antes #230827

  • Autor del tema
  • Webmarketingtrento
  • Fuera de línea
  • Fresh Breezer
  • Fresh Breezer
  • Mensajes: 15
  • Gracias recibidas: 0
Thanks Mihaela, I immediately check with which solution to proceed.
I'll update you as soon as verified

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

Form for personality profile, calculation 2 años 6 meses antes #230834

  • mihaela
  • Fuera de línea
  • Developer
  • Developer
  • Mensajes: 3128
  • Karma: 105
  • Gracias recibidas: 415
Hello again,

Ok, I hope you'll manage to set this. Let me know then.

Regards,

Mihaela

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

Form for personality profile, calculation 2 años 6 meses antes #230887

  • Autor del tema
  • Webmarketingtrento
  • Fuera de línea
  • Fresh Breezer
  • Fresh Breezer
  • Mensajes: 15
  • Gracias recibidas: 0
Hi Mihaela,
if instead of adding I matched each answer option instead of a numeric value a letter (a, b, c, d, e) I could have the final result of the letters selected and based on the one with greater repetition redirect the user towards a precise url?

exemple:

aabcdae -> prevail A then go to page x

thank you

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

Última Edición: Post by Webmarketingtrento.
  • Página:
  • 1
  • 2
  • 3
Tiempo de carga de la página: 0.053 segundos