Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Confirm Box

Reply
Thread Tools

Confirm Box

 
 
Deepan - M.Sc(SE) - 03MW06
Guest
Posts: n/a
 
      03-07-2008
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
 
Reply With Quote
 
 
 
 
SAM
Guest
Posts: n/a
 
      03-07-2008
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
div box questions; float text around a box, fit box to image size Gnarlodious HTML 4 05-05-2010 11:30 AM
confirm box when clicking Delete Linkbutton in DG Calvin Lai ASP .Net 4 02-04-2004 03:03 PM
Finally found how to display confirm dialog box Tony Baker ASP .Net 0 12-17-2003 11:59 AM
Javascript Confirm box with asp.net Sudhir ASP .Net 1 11-13-2003 03:25 PM
How to popup confirm message box in asp.net Padam Jain ASP .Net 1 07-14-2003 08:19 AM



Advertisments