Prolem in Delete Confirmation

Reply

Join Date: Feb 2008
Posts: 9
Reputation: themailsian is an unknown quantity at this point 
Solved Threads: 0
themailsian themailsian is offline Offline
Newbie Poster

Prolem in Delete Confirmation

 
0
  #1
Jul 14th, 2008
Dear All,

I have a problem with delete confirmation code in java script.

i m using this code:
  1. <script LANGUAGE="JavaScript">
  2.  
  3. function confirmSubmit()
  4. {
  5. var agree=confirm("Are you sure you wish to continue?");
  6. if (agree)
  7. return true ;
  8. else
  9. return false ;
  10.  
  11. }
  12.  
  13. </script>
in Asp page on click of hyperlink tage message displays and on click of Cancel the next page is called where as in simple html file hyper tag code acts properly.

please suggest in this regars what i have to day and where i m making mistake
Last edited by Tekmaven; Jul 14th, 2008 at 11:13 pm. Reason: Added code tags
Needo
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 7
Reputation: nrvinayak is an unknown quantity at this point 
Solved Threads: 0
nrvinayak nrvinayak is offline Offline
Newbie Poster

Re: Prolem in Delete Confirmation

 
0
  #2
Jul 14th, 2008
Hi:

The javascript seems to work perfect even in asp page.

I can't find any mistake in the syntax of Javascript.

I presume you are giving link in your asp script like

<a href="nextfile.asp" onclick="confirmSubmit()">Click here</a>

If you are using response.write to generate the hyperlink use chr(34) to produce the double quote character (")

Sharing some more code will help us to guide you better

NR
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 9
Reputation: themailsian is an unknown quantity at this point 
Solved Threads: 0
themailsian themailsian is offline Offline
Newbie Poster

Re: Prolem in Delete Confirmation

 
0
  #3
Jul 15th, 2008
Dear I m using this script with in ASP file under response.write
as
response.write "<a href='nextfile.asp?mode=delete&id=5' onclick = confirmsubmit()>Delete</a>" if i use in this way message box display but either i click ok or cancel nextfile page is called and there action is performed.
where as if the same code is written in plain html page in simple
<a href="nextfile.asp?mode=delete&id=5" onclick = confirmsubmit()>Delete</a> here it work properly measn in message box if i cancel it remain on the same page.

Pls suggest what is the problem in ASP code format .


Regards,
Needo
Needo
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 133
Reputation: vicky_rawat is an unknown quantity at this point 
Solved Threads: 17
vicky_rawat's Avatar
vicky_rawat vicky_rawat is offline Offline
Junior Poster

Re: Prolem in Delete Confirmation

 
0
  #4
Jul 15th, 2008
Hi,
Use this code
  1. response.write "<a href='nextfile.asp?mode=delete&id=5' onclick='return confirmSubmit()'>Delete</a>"

return is compulsory here as we will need to stop the onclick event.
Vivek Rawat
Keep solving complexities.
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 7
Reputation: nrvinayak is an unknown quantity at this point 
Solved Threads: 0
nrvinayak nrvinayak is offline Offline
Newbie Poster

Re: Prolem in Delete Confirmation

 
0
  #5
Jul 15th, 2008
Originally Posted by themailsian View Post
Dear I m using this script with in ASP file under response.write
as
response.write "<a href='nextfile.asp?mode=delete&id=5' onclick = confirmsubmit()>Delete</a>" if i use in this way message box display but either i click ok or cancel nextfile page is called and there action is performed.
where as if the same code is written in plain html page in simple
<a href="nextfile.asp?mode=delete&id=5" onclick = confirmsubmit()>Delete</a> here it work properly measn in message box if i cancel it remain on the same page.

Pls suggest what is the problem in ASP code format .


Regards,
Needo
Hi:

Just see the post by Vicky.. Follow his guidelines and that should solve your problem.

Cheers

NRV
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the ASP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC