javascript - jQuery clone() problem -
i using jquery clone form input field when user click on add button goes fine, have problem if write in form input field , click add button, jquery copy text new cloned input element also.
you can try demo: http://jsbin.com/ikebil/2/edit
steps:
open link , click render
type in input field
click on add button create new input field copy text written in previous one.
original code: http://charlie.griefer.com/blog/2009/09/17/jquery-dynamically-adding-form-elements/
so need remove text comes if written in previous element.
the best solution make copy of element before it's being populated data, , use "safe" copy , clone it.
it's faster , safer => see working example
Comments
Post a Comment