Sha256: 812e1276a6462ceb7ad5c898fe28f4218956b4596e28314b71cd7cad9fc13891
Contents?: true
Size: 442 Bytes
Versions: 12
Compression:
Stored size: 442 Bytes
Contents
$(document).ready(function(){ $('form').on('click', '.add_fields', function(e) { time = new Date().getTime(); regexp = new RegExp($(this).data('id'), 'g'); $(this).before($(this).data('fields').replace(regexp, time)); e.preventDefault(); }); $('form').on('click', '.remove_fields', function(e){ $(this).prev('input[type=hidden]').val('1'); $(this).parent().parent().parent().hide(); e.preventDefault(); }); });
Version data entries
12 entries across 12 versions & 1 rubygems