SitePoint Sponsor

User Tag List

Results 1 to 7 of 7

Thread: alert code

  1. #1
    Non-Member
    Join Date
    Mar 2005
    Posts
    832
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    alert code

    Hi does anyone know the alert code with an ok button and cancel button?

  2. #2
    The Omnipresent [ArcanE]'s Avatar
    Join Date
    Mar 2005
    Location
    Belgium
    Posts
    214
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You mean how to show a javascript alertbox when clicking on a submit button?

    If so this really belongs in Javascript forums but here is the code anyway

    Code:
    <input type="submit" name="ok" value="OK" onclick="alert('This is an alert! Change this text!')" />
    Webdevelopment : Skyrocket Concepts Inventis Web Architects
    Ain't got time for the future or the past.
    Live for the moment, make it last.

  3. #3
    Non-Member
    Join Date
    Mar 2005
    Posts
    832
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yeah ike that buti want a cancel button and a ok button

  4. #4
    Who turned the lights out !! Mandes's Avatar
    Join Date
    May 2005
    Location
    S.W. France
    Posts
    2,496
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    You want a confirm box then. Try this piece of code
    Code:
     
    <html>
    <body bgcolor="#FFFFFF">
    <script language="JavaScript">
    <!--
    function confirm_entry()
    {
    input_box=confirm("Click OK or Cancel to Continue");
    if (input_box==true)
    { // Output when OK is clicked
      alert ("You clicked OK"); 
    } else { // Output when Cancel is clicked
      alert ("You clicked cancel");
    }
     
    }
    -->
    </script>
     
    Click <a href="javascript:confirm_entry()">here</a>
     
    <form onSubmit="confirm_entry()">
    <input type="submit" >
    </form>
     
    </body>
    </html>
    A Little Knowledge Is A Very Dangerous Thing.......
    That Makes Me A Lethal Weapon !!!!!!!!

    Contract PHP Programming

  5. #5
    Non-Member
    Join Date
    Mar 2005
    Posts
    832
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yes that code is what im after, how can i make the ok button to go to a page named delentry.php and the cancel button to cancel it?

  6. #6
    is_empty(2); foofoonet's Avatar
    Join Date
    Mar 2006
    Posts
    1,000
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Go to the Javascript forum and ask there, as has already been said.

    Or look in javascript.internet.com - loads of cool, simple uses of JS in there.
    Upgrading to Mysql 5? Auto-increment fields now strict
    use NULL
    Or zero or leave the field name out completely.

  7. #7
    Non-Member
    Join Date
    Mar 2005
    Posts
    832
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    k thanks


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
  •