In my form, each question is on a separate page (div), with the ability to show and hide pages. If a user receives a response from the API with a status of "accepted", they are redirected to a URL. I'm currently trying to display a div if their status is "rejected".
The response object looks like this:
{status: "REJECTED", redirectUrl: null, loanID: null, errors: Array(0), rejectReason: "Existing Customer", …}
My current if/else statement is as follows:
if(b.status == "ACCEPTED") {
window.location = b.redirectURL;
}
else {
// need help here
}
I attempted to use the following method but it did not work:
document.getElementById('page18').style.visibility = "visible";
Here is how the end portion of my form is structured:
Page 17 is where users land after hitting submit, and page 18 is the rejection page that should be shown if they receive a rejected response.
<!---PAGE 16 -->
<div id="page17" class="pageform">
<h3 style="text-align: center;">Thank you for your submission!</h3>
<h4 style="text-align: center;"> Please wait one moment while we process your application.</h4> <br> <br>
<div class="loading">Loading…</div>
</div>
<!---REJECT PAGE -->
<div id="page18" class="pageform">
<h3 style="text-align: center;">Sorry, we were unable to fund your request at this time.</h3>
</div>