I have a form with five fields (Name, Title, Date, Name 2, Title 2). The Name2 and Title2 fields are read only and I would like to populate these to fields with the input entered in the Name and Title fields. I have created CSS classes for all fields (Name1, Title1, Name2, Title2). I have the following code; however, I'm not having any luck.
function populateFields() {
var x = $('.patName1 input').val();
var y = $('.DOB1 input').val();
var z = $('.MRN1 input').val();
$('.patName2 input').val(x);
$('.DOB2 input').val(y);
$('.MRN2 input').val(z);
}