I have a popup from index.ejs, called math.ejs. After pressing the submit Ok button, I want the math.ejs popup to close and to show the calculated value on index.ejs. But right now, when I press the submit button, the popup goes to index.ejs and updates it there; it does not close. It does not update it on the normal index.ejs browser page. I have to refresh that page for it to update.

<form class="" action="/index" method="post" name="mathform">
      <p>Value: <%= myValue %></p>
      <button class="btn btn-md" name="button" value="confirm" onclick="CloseAndRefresh();">Ok</button>

<script language="javascript">
  function CloseAndRefresh() {
    setTimeout(function() {
  }, 3000);

Any help would be appreciated. Thank you.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.