Javascript clone form?

Posted by user202987 on Stack Overflow See other posts from Stack Overflow or by user202987
Published on 2010-04-17T18:37:00Z Indexed on 2010/04/17 18:43 UTC
Read the original article Hit count: 188

Filed under:
|
|

I need to copy a form information with all types of elements and send it with AJAX.

Tried these: 1. cloneNode on the form. - Doesn't work with IE, only copies text stuff properly.

  1. cloneNode on each element.

    • Doesn't work with IE, only copies text stuff properly.
  2. Making new textareas for each element, and copying the value in.

    • Doesn't work for textareas in IE, formatting is lost.

I imagine a combination of those 3 would work for IE and FF but is there any decent solution to this? Shortness of code is a priority.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about clone