Results 1 to 2 of 2

Thread: Alert/Confirm box for saving data

  1. #1
    Join Date
    Oct 2011
    Posts
    39
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default Alert/Confirm box for saving data

    Hi...

    I have a button to generate data or save all data in the database.

    Now, I want that when i click the button to generate data it will not save all data, i want first appear an alert or confirm box asking if "Do you want to save data?" and i want it has a OK and Cancel...when the OK was pressed it will automatically save data and when the Cancel was pressed the alert/confirm box will closed?


    Is it possible?

    Can you give me an idea or example..But now i searching also for that.


    here is my code:
    Code:
    <input type="button" name="GENERATE_DATA" value="GENERATE DATA" style="width: 200px;">
    and i have a php file for saving data...


    Thank you so much

  2. #2
    Join Date
    Oct 2008
    Posts
    60
    Thanks
    2
    Thanked 7 Times in 7 Posts

    Default

    Try this

    Code:
    <input type="button" name="GENERATE_DATA" value="GENERATE DATA" style="width: 200px;" onclick="return (confirm('do you really want to save data?'));">

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •