Page 1 of 1

Submit Confirmation

Posted: Thu Nov 24, 2005 1:38 pm
by taha
I have the following code for a submit confirmation dialog box

Code: Select all

function verifySave()
  {
     msg = confirm("Are you sure you want to save this data?")

     if (msg != 0)
     {              
       submitSave();
     }
  }
the submitSave() function is where all the meat is...but it doesn't seem to enter into that function at all?
any idea why???

Posted: Fri Nov 25, 2005 9:38 am
by php3ch0
I must admit Javascript is not my stron point but I belive your error lies with:

Code: Select all

if(msg !=0)
try this

Code: Select all

function verifySave() 
  { 
     msg = confirm("Are you sure you want to save this data?") 

     if (msg) 
     {              
       submitSave(); 
     } else { alert("did not save data") }

  }

Posted: Mon Nov 28, 2005 10:16 am
by taha
Thanks php3ch0, that worked!