SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict chartahir's Avatar
    Join Date
    Oct 2006
    Location
    Karachi, Pakistan
    Posts
    253
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    javascript confirmation

    On my page there is a button to delete a record, and i want to show a message box to user with options of YES or NO , with yes selected the record will be deleted else nothing happens , how can i do this using javascript ?

    Help Plz.
    chartahir

  2. #2
    SitePoint Wizard
    Join Date
    Nov 2004
    Location
    Nelson BC
    Posts
    2,310
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You don't get to choose YES or NO, but you can choose OK and CANCEL

    Code:
    var response = confirm("really delete this record?");
    
    if (response) {
      // they clicked ok
    } else {
      // they clicked cancel
    }

  3. #3
    SitePoint Addict chartahir's Avatar
    Join Date
    Oct 2006
    Location
    Karachi, Pakistan
    Posts
    253
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thanks...

    Thanks , it works fine.
    chartahir


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
  •