Submit Confirmation

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
taha
Forum Newbie
Posts: 17
Joined: Tue Nov 22, 2005 2:40 pm

Submit Confirmation

Post 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???
User avatar
php3ch0
Forum Contributor
Posts: 212
Joined: Sun Nov 13, 2005 7:35 am
Location: Folkestone, Kent, UK

Post 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") }

  }
taha
Forum Newbie
Posts: 17
Joined: Tue Nov 22, 2005 2:40 pm

Post by taha »

Thanks php3ch0, that worked!
Post Reply