I have an equipment control system. In this system, while the user fills out the form, he has the option to add another field to register another equipment that will be associated with a client. To do this functionality I used a code in javascript
<script type="text/javascript">
$(document).ready(function () {
var $link = $('#add_answer');
var $model = $link.prev('.equipamento');
$link.click(function () {
var $clone = $model.clone(false);
$(this).before($clone);
$clone.wrap('<div class="wrapper"></div>')
.after('<a href="javascript:void(0)" class="remove"></a>')
.addClass('added')
.parent()
.hide()
.fadeIn();
});
$('a.remove').live('click', function () {
$(this).parent().fadeOut('normal', function () {
$(this).remove();
});
});
});
</script>
How do I access form fields using JQuery.
Can you help me? Any suggestion? Am I doing the right thing? Is there a better way to do this?
note: I did not program this javascript