<script> var saved = false; var nextPageUrl; function save(){ // save data code here} function cfmSave(){ if (saved===true) { return true; } else { if(confirm("notice here")){ save(); return true; } else { return true; }
} } function nextStep(url){ nextPageUrl = url; if(cfmSave()){ window.location= url; // location next page } }so easy
var saved = false;
var nextPageUrl;
function save(){
// save data code here}
function cfmSave(){
if (saved===true) {
return true;
}
else
{
if(confirm("notice here")){
save();
return true;
}
else
{
return true;
}
}
}
function nextStep(url){
nextPageUrl = url;
if(cfmSave()){
window.location= url; // location next page
}
}so easy