Confirm Box

  • Thread starter Deepan - M.Sc(SE) - 03MW06
  • Start date
D

Deepan - M.Sc(SE) - 03MW06

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
 
S

SAM

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';
}
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top