1 Reply Latest reply on Mar 18, 2014 9:57 PM by Sudeshnasarkar27

    HTML forms in Edge Animate

    DesignByte

      Hi,

       

      I added a select statement to a <div> element on stage from_sp.

      Do you know how i could pass the selected value to a variable on stage?

       

      Here's my code on stage:

       

      sym.$('from_sp').html('<select name="from_sp_dd">'

      +'<option value="0" selected>0</option>'

      +'<option value="1" >1</option>'

      +'<option value="2" >2</option>'

      +'<option value="3" >3</option>'

      +'</select>');

       

      Thanks!

        • 1. Re: HTML forms in Edge Animate
          Sudeshnasarkar27 Adobe Employee

          Hi ,

           

          You can try it this way -

          sym.$('from_sp').html('<select id="from_sp_dd">'

          +'<option value="0" selected>0</option>'

          +'<option value="1" >1</option>'

          +'<option value="2" >2</option>'

          +'<option value="3" >3</option>'

          +'</select>');

           

          sym.$('from_sp').change(function() {

            var e = document.getElementById("from_sp_dd");

            var selectedValue = e.options[e.selectedIndex].value;

            console.log(selectedValue);

           

          });

           

          Attaching a simple sample to show the selected value in the console view.

           

          Thanks and Regards,

          Sudeshna Sarkar

          1 person found this helpful