Bienvenue, Invité
Nom d'utilisateur : Mot de passe : Se souvenir de moi

SUJET : variables, QID and javascript

variables, QID and javascript il y a 1 an 4 mois #94123

  • rodriguezm1
  • Portrait de rodriguezm1
  • Hors ligne
  • Fresh Lemon
  • Messages : 10
  • Karma: 0
Not sure if this is the right part of the forum or not. Here it goes:


I have a series of questions. They are strings. Call them Question1, Question2, Question3, etc.

I want to write script to generate the QID and display stuff. Example:
<script type="text/javascript" charset="utf-8">
var i = 1; 
var theQID = "{Question" + i + ".answer}";
document.write(theQID);
</script>

I also tried
<script type="text/javascript" charset="utf-8">
var i = 1; 
var theQID = "{that.Question" + i + ".answer}";
document.write(theQID);
</script>

Both of these codes to not display anything. But this code DOES display something
<script type="text/javascript" charset="utf-8">
 
document.write({Question1});
 
</script>

Can someone help me to know what is going on with this? Is this possible to do? Or do you always have to input the QID literally, and not use text manipulation with variables? Thanks
Dernière édition: il y a 1 an 4 mois par rodriguezm1.
L'administrateur a désactivé l'accès en écriture pour le public.

variables, QID and javascript il y a 1 an 4 mois #94136

  • DenisChenu
  • Portrait de DenisChenu
  • Hors ligne
  • Moderator Lime
  • Messages : 6207
  • Remerciements reçus 788
  • Karma: 238
Hello,

USe directly EM:
Question qid: {QID}
Question SGQ: {SGQ} (for example #answer{SGQ} giv you the id of the input short text).

Denis
L'administrateur a désactivé l'accès en écriture pour le public.
Modérateurs: ITEd
Temps de génération de la page : 0.133 secondes
Donation Image