2 Replies Latest reply on Oct 17, 2014 6:28 AM by giocatore1234

    [v 2014.1]Can't get input type text value from code

    giocatore1234 Level 1

      Hi everyone,

       

      i've noticed that there are a lot of changes between 2014.0 and 2014,1 version.

       

      In the older version i used to put an input type text and get its value this way:

       

      //-------------------- put code -----------------------------------

      var text_element= sym.$("t_element")

      text_element.html("");

      inputtext_element = $('<input />').attr({'type':'text', 'placeholder':'', 'id':'text_element', 'size':'30'});

      inputtext_element.css ('background-color', '#ffffff');

      inputtext_element.css ('font-size', '14px');

      inputtext_element.css ('color', '#000000');

      inputtext_element.css ('outline', 'none');

      inputtext_element.css ('border', 'none');

      inputtext_element.appendTo(text_element);

       

      //------------------- get Code -------------------------------

       

      var input_value = $("#text_element").val();

      if(  input_value == "something" ) {

       

      doSomething();

       

      } else {

       

      doSomethingElse();


      }

       

      //-------------------- end code ------------------------------

       

       

       

      But now i can't use this system.

      i've inserted the input type text this way:

       

      sym.$("t_element").html("<input type='text' placeholder='write here!!' id='textElement' size='30' style='border:none ; background-color:#FFF ; font-size:11pt ; color:#000000;'/>");

       

      but now i can't retrive its value.

       

       

      thanks for the help!