Home » Javascript » link button to another page

link button to another page

Posted by: admin August 19, 2018 Leave a comment


I know there a lot of things related to this stuff but I find it quite hard to implement

My current result is this. I added some details to the code to add to the DB then as I pressed the next button, it goes to another same page but its all about update and its not going anywhere to the page that I linked it to.

So far, this is what I’ve made to link the button to another page


and this

if(employeeExist) {
   $alertDiv("success","Company related information was successfully updated.",true);
    } else {
   $alertDiv("success","Company related information was successfully added.",true);
    var fam = "${pageContext.request.contextPath}/employee/details/family?id="+empID;

Here is the redirect part of my code

    function Redirect() {

and the HTML part

<!-- Update -->
<div class="col-md-2 col-md-offset-8">
  <div class="input-group">
    <span class="input-group-btn">
			<button id = "updateBtn" class="btn btn-success marginBtn">Update</button>
<!-- Next -->
<div class="col-md-2 col-md-offset-7">
  <div class="input-group">
    <span class="input-group-btn">
			<button id = "nextBtn" class="btn btn-primary marginBtn" onclick="Redirect();">Next</button>