-1

I have this JavaScript code, in this scenario if data.rval == 2 then it should redirect to signin page and display the message in that page only

if(data.rval == 1) {
            window.location = "/offerletter/index";
            Application.PageAlertBox.Show('Sucess', ['Successfully Loggedin.']);
        } else if(data.rval == 2) {
            window.location = "/signin";
            Application.PageAlertBox.Show('info', ['OTP is Expired, New OTP has been sent on official email id, Please try again.']);
        } else if(data.rval == -4) {
            Application.PageAlertBox.Show('error', ['OTP is Invalid. Please Enter correct OTP.']);
        } else {
            Application.PageAlertBox.Show('error', [data.Message]);
        }

1 Answers1

1
if(data.rval == 1) {
        window.location = "/offerletter/index";
        Application.PageAlertBox.Show('Sucess', ['Successfully Loggedin.']);
    } else if(data.rval == 2) {
        window.location = "/signin?info=OTP is Expired, New OTP has been sent on official email id, Please try again.";
    } else if(data.rval == -4) {
        Application.PageAlertBox.Show('error', ['OTP is Invalid. Please Enter correct OTP.']);
    } else {
        Application.PageAlertBox.Show('error', [data.Message]);
    }

and in the signin page:

Application.PageAlertBox.Show('info', ['<?php echo $_GET['info']?>']);
Saeed M.
  • 2,216
  • 4
  • 23
  • 47