3 Replies Latest reply on Jan 5, 2013 3:54 PM by pmfr01

    Making a div a <input /> field

    pmfr01 Level 2

      How do I turn an existing div into an <input /> field? I've already tried:


      myVar.html('<input type="text" value="" id="email"/>');

      The problem is that this way it adds a div inside the one I have...


      The purpose is to create e-mail fields.

        • 1. Re: Making a div a <input /> field
          pmfr01 Level 2

          Ok, I figured how to convert a div into an editable text field:




          Now, how do I make the text entered in this div valid for processing email address, subject, message, etc?...

          • 2. Re: Making a div a <input /> field
            Jerry Witt Level 2

            Although I am curious if there is a way to do this too, I can suggest a different approach:


            What if you created the page first? That way you could group all the form elements together in the right divs, check out the logic and make sure the form sends the email. From there you could open the HTML page in Edge and add additional graphics and any animation.


            I know this doesn't directly answer your quetion, but sometimes an alternate approach leads to a better solution.

            • 3. Re: Making a div a <input /> field
              pmfr01 Level 2


              I do have my contact form ready, just need the code to make it work. As to your approach, I don't think I understand it...