# How to create random value field based on the input of another field?

• elio69
Asked on January 20, 2017 at 05:27 AM

Bonjour Jotform,

Je voulais savoir si c'était possible de faire la chose suivante :

Avoir une case où la personne peut mettre un nombre, et que cela donne un résultat chiffré (automatiquement)

Par exemple :

Question :

Combien avez-vous de m² ?

1 < x < 2000

--> = 100€

2001 < x < 4000

--> = 200€

x étant le nombre de m² de la personne.

Merci !

• Nik_C
Answered on January 20, 2017 at 06:33 AM

There is a  workaround that could achieve this.

You can use a Random Value Generator Widget that will place its value inside of the another field when something is typed in the first field.

For example, if we have two fields in the form and we set the condition that says: If field1 is filled copy random value to field2.

Here is how to do that:

1. Put Random value generator to the form:

2. Make condition that will copy the value from random field to the second field.

Random value generator can be hidden of course.

Please check my test form where I achieved that: https://form.jotform.com/70186744497973

If you have any further questions please let us know.

Thank you!

• elio69
Answered on January 20, 2017 at 09:02 AM

Bonjour,

Merci pour votre réponse, mais je ne pense pas avoir compris.

Pourriez-vous me faire un exemple concret ?

J'ai téléchargé le widget "Random Value Generator"

Je m'excuse d'avance !

• BDAVID
Answered on January 20, 2017 at 11:47 AM

"Combien avez-vous de m² ?

1 < x < 2000

--> = 100€

2001 < x < 4000

--> = 200€"

It looks like you want to create a calculation, here is my example:

1) Add to Form Calculation widgets on your form, and create the following condition: https://www.jotform.com/help/268-Conditional-Logic-Inserts-Text-Calculation-Into-A-Field

Conditions:

Let us know if you need more help.