943,864 Members | Top Members by Rank

Ad:
  • ASP Discussion Thread
  • Unsolved
  • Views: 1181
  • ASP RSS
Jul 14th, 2008
0

Prolem in Delete Confirmation

Expand Post »
Dear All,

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

i m using this code:
ASP Syntax (Toggle Plain Text)
  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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
themailsian is offline Offline
9 posts
since Feb 2008
Jul 14th, 2008
0

Re: Prolem in Delete Confirmation

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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
nrvinayak is offline Offline
7 posts
since Jul 2008
Jul 15th, 2008
0

Re: Prolem in Delete Confirmation

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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
themailsian is offline Offline
9 posts
since Feb 2008
Jul 15th, 2008
0

Re: Prolem in Delete Confirmation

Hi,
Use this code
ASP Syntax (Toggle Plain Text)
  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.
Reputation Points: 28
Solved Threads: 19
Junior Poster
vicky_rawat is offline Offline
137 posts
since Jun 2008
Jul 15th, 2008
0

Re: Prolem in Delete Confirmation

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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
nrvinayak is offline Offline
7 posts
since Jul 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP Forum Timeline: How to make a newsletter
Next Thread in ASP Forum Timeline: filesystem to HTTP





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC