This topic is locked
[SOLVED]

 How to Save Record and redirect to view page

11/8/2014 10:36:17 AM
PHPRunner General questions
J
jackwood author

I Create Function Script to to Save Record and redirect to view page (in Javascript onload), But it is Not Work for me (PHPR 8.0)

-----------------------------------------------------------------------------------------------

this.on('beforeSave', function(formObj, fieldControlsArr, pageObj){
if (confirm('Are you sure wanna Save record?')){

return true;

header("Location: sparepartissue_view.php?editid1= .$data["ID"])");

exit();
}else{

return false;

}
});
-------------------------------------------------------------------------------------------------

Is There any suggestion ?

Sergey Kornilov admin 11/8/2014

You cannot put PHP code in Javascript event like beforeSave. Use AfterAdd event:

header("Location: sparepartissue_view.php?editid1=" .$keys["ID"]);

exit();
J
jackwood author 11/8/2014

Yes Sergey, It is working properly Now. Thank you
But, if I Try to Click Cancel Button on the Message, The Save Button is Disable.
I want IF I Click The Cancel Button, The Save Button is Still Enable.
Thank you