Do you mean that the form is loaded without the page being refreshed/changed or with the page refresh?
Anyway, if the page is refreshed after the user pressed the button, you can just simply retrieve the form values using PHP and then echo that as values inside the full form:
// Retrieving the form values of the small form: $firstname = $_POST['firstname']; $lastname = $_POST['lastname']; // Echoing them inside the full form: echo "First name: <input type='text' name='firstname' value='".$firstname."' />"; echo "Last name: <input type='text' name='lastname' value='".$lastname."' />"; // The rest of the form: echo "Address: <input type='text' name='address' value='' />"; echo "Zip: <input type='text' name='zip_code' value='' />";
var LastName = document.getElementById('lastname').value;