nickg
06/21/2023, 4:48 AMMatt Jones
06/21/2023, 12:52 PMMichael Schmidt
06/21/2023, 12:52 PMnickg
06/21/2023, 3:30 PMMichael Schmidt
06/21/2023, 3:39 PM{
"displayName": "Johnny Bravo",
"expirationDate":'8/27/2004",
"id": 100
}
then on success of the fetch update your fields on your dialog form like you would on any element on a page....
function getUserInfo(UserID)
{
var formData = new FormData();
formData.append("UserID", UserID);
var url = "<https://example.com/userInfo/>";
fetch(url, {"method": "post", body: formData } )
.then(response=> response.json())
.then(result =>
{
document.querySelector("displayName").value = result.displayName;
document.querySelector("expirationDate").value = result.expirationDate;
}
);
}
nickg
06/21/2023, 3:46 PMMichael Schmidt
06/21/2023, 3:48 PMnickg
06/21/2023, 3:50 PM