in reply to Adding a pop up confirmation box

G'day Terry,

Take a look at "CGI: CREATING A JAVASCRIPT ACTION BUTTON" and ""alert" or prompt box from perl cgi script".

-- Ken

Replies are listed 'Best First'.
Re^2: Adding a pop up confirmation box
by terrykhatri (Acolyte) on Jul 06, 2014 at 08:33 UTC
    Hi, I added the following code to the script and its not working can you please help me correct it.
    print header; print <<EOF; <script type="text/javascript"> function confirmOk() { return window.confirm("Confirm deletion?"); } </script> EOF
    And
    # If the form was properly submitted, save the data if ($input{"go"} eq "DELETE") { print button(-name=>'Delete', -value=>'DO you really want to delete it ?', -onClick=>"return confirmOk()"); $query = "DELETE ....
    Rgds Terry