Just use getCurrentItem to get your wanted data from the dataset.
https://www.wix.com/corvid/reference/wix-dataset.Dataset.html#getCurrentItem
$w("#input1").value = $w('#dataset1').getCurrentItem();
// for all fields
$w("#input1").value = $w("#dataset1").getCurrentItem().fieldName;
// for certain field
Then use setFieldValue or setFieldValues to set the field of the current element on your page.
Dataset - Velo API Reference - Wix.com
Dataset - Velo API Reference - Wix.com
export function Submit_click(event, $w) {
$w('#dataset2').setFieldValue('fname', $w('#input1').value);
Then just save it using the save function.
Dataset - Velo API Reference - Wix.com