Confirm Box

Discussion in 'Javascript' started by Deepan - M.Sc(SE) - 03MW06, Mar 7, 2008.

  1. Hi all,
    I am having a function named change() in abc.js file. I am
    referring this file in a CGI file delete.cgi. When the user clicks a
    submit button i am calling this function change() for the onClick
    event in the CGI file.

    Inside the change() function i am using confirm("Are you sure to
    delete this entry?"). Now how can i pass the users selection[as
    whether he/she selected okay or cancel] to the CGI script?

    Please help to solve this?

    Thanks,
    Deepan
    Deepan - M.Sc(SE) - 03MW06, Mar 7, 2008
    #1
    1. Advertising

  2. Deepan - M.Sc(SE) - 03MW06

    SAM Guest

    Deepan - M.Sc(SE) - 03MW06 a écrit :
    > Hi all,
    > I am having a function named change() in abc.js file. I am
    > referring this file in a CGI file delete.cgi. When the user clicks a
    > submit button i am calling this function change() for the onClick
    > event in the CGI file.
    >
    > Inside the change() function i am using confirm("Are you sure to
    > delete this entry?"). Now how can i pass the users selection[as
    > whether he/she selected okay or cancel] to the CGI script?


    Dont' know about CGI scripts
    (how a cgi can interact with a loaded page ?)
    but in JS it's quit easy :

    if(confirm('sure to go ahead ?'))
    alert('OK');
    else
    alert('see you latter');

    or

    var OK = confirm('sure to go ahead ?');
    if(OK) { alert('thanks'); /* and other foos */ }
    else
    alert('you are wrong');



    function change() {
    var OK = confirm('sure to keep this choice ?');
    if(OK) { alert('thanks'); /* and other foos */ }
    document.forms[0].myCheckbox.checked = OK;
    // eventually a hidden report
    document.forms[0].hiddenInput.value= OK? 'yes' : 'no';
    }

    --
    sm
    SAM, Mar 7, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Padam Jain
    Replies:
    1
    Views:
    1,241
    Anatoly
    Jul 14, 2003
  2. Sudhir
    Replies:
    1
    Views:
    3,890
    Anatoly
    Nov 13, 2003
  3. Tony Baker
    Replies:
    0
    Views:
    6,683
    Tony Baker
    Dec 17, 2003
  4. Calvin Lai
    Replies:
    4
    Views:
    7,924
    Calvin Lai
    Feb 4, 2004
  5. Gnarlodious
    Replies:
    4
    Views:
    17,551
    elizas
    May 5, 2010
Loading...

Share This Page