Found a solution. I just add or remove the html5 required
tag on load via Javascript. This way the js who duplicates the form can do whatever it wants and the html remains untouched:
// adds required tag to inputs on page load
$("#shippingAddress-firstName").attr("required", "");
$("#shippingAddress-lastName").attr("required", "");
$("#shippingAddress-address1").attr("required", "");
$("#shippingAddress-zipCode").attr("required", "");
$("#shippingAddress-city").attr("required", "");
$(".js-address-country").attr("required", "");
// listens to billing address checkbox
$("#billingAddressSameAsShipping").change(function () {
if ($(this).is(":checked")) {
//removes required attributes when checkbox is checked (billing address form invisible)
$("#billingAddress-firstName").removeAttr("required");
$("#billingAddress-lastName").removeAttr("required");
$("#billingAddress-address1").removeAttr("required");
$("#billingAddress-zipCode").removeAttr("required");
$("#billingAddress-city").removeAttr("required");
$(".js-address-country").removeAttr("required");
} else {
//adds required attribute when checkbox is unchecked (billing address form visible)
$("#billingAddress-firstName").attr("required", "");
$("#billingAddress-lastName").attr("required", "");
$("#billingAddress-address1").attr("required", "");
$("#billingAddress-zipCode").attr("required", "");
$("#billingAddress-city").attr("required", "");
$(".js-address-country").attr("required", "");
}
});
Aditionaly the required tag is added or removed based on the Billing address checkbox.
This can be written much better I'm sure.