How to Copy Form Values to Another Using Jquery

$("#SubmitButton").click(function () { $(':input[name]', "#searchForm").each(function () { $...

$("#SubmitButton").click(function () {
  $(':input[name]', "#searchForm").each(function () {              
    $('[name=' + $(this).attr('name') + ']', "#generateReportForm").val($(this).val())

In the above code we have 2 forms with ids: searchForm and generateReportForm. searchForm has SubmitButton inside it as child element and when it's click it will copy all its field values into generateReportForm.


web 7023822261616621662

Post a Comment Default Comments


Are you looking for freelancers in the Philippines? Get in touch.


If you like what I do, you can support this channel by buying me a coffee. I would be grateful for your contribution! Your donations will help me create more FREE online courses and learning materials for programmers and remote workers.