0 Replies Latest reply on Jan 12, 2014 10:57 PM by oliverS

    login, password, input,

    oliverS

      Hello everybody,

       

      I have following problem:

       

      I want to make an input field, which has different actions by different input text.

       

      Thanks to "redesign" I found the following code which I adjust in my project.

       

      It works with one input_text fine, but what do I have to do if I want to use two or more

      input_text with different actions.

       

       

       

      var text1 = 'one';

      var text2 = 'two';

       

       

      // prepare email field

      var userInput = sym.$("userInput")

      userInput.html("Enter your answer: ");

      inputAnswer = $('<input />').attr({'type':'text', 'value':'', 'id':'userInput'});

      inputAnswer .css ('font-size', 14);

      inputAnswer .css ('width', 150);

      inputAnswer .appendTo(userInput);

       

       

       

       

      sym.$('btn').click(function(){

      var info = inputAnswer.attr("value");

       

       

      if (info==text1){

      sym.stop("one");

      sym.$("stop_here").html("one")

       

      } else{

      alert('wrong');

      }

      });

       

       

      So the question is if I want for example ad a second input:

      if (info==text1){

      sym.stop("do this");

      sym.$("stop_here_01").html("do this")

       

      if (info==text2){

      sym.stop("do something else");

      sym.$("stop_here_02").html("do something else")

       

       

      I tryed different stuff but it does not work,

      maybe there is some help.

       

      greetings from germany