| | |
Prolem in Delete Confirmation
Please support our ASP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Feb 2008
Posts: 9
Reputation:
Solved Threads: 0
Dear All,
I have a problem with delete confirmation code in java script.
i m using this code:
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
I have a problem with delete confirmation code in java script.
i m using this code:
ASP Syntax (Toggle Plain Text)
<script LANGUAGE="JavaScript"> function confirmSubmit() { var agree=confirm("Are you sure you wish to continue?"); if (agree) return true ; else return false ; } </script>
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
•
•
Join Date: Jul 2008
Posts: 7
Reputation:
Solved Threads: 0
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
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
•
•
Join Date: Feb 2008
Posts: 9
Reputation:
Solved Threads: 0
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
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
Hi,
Use this code
return is compulsory here as we will need to stop the onclick event.
Use this code
ASP Syntax (Toggle Plain Text)
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.
Keep solving complexities.
•
•
Join Date: Jul 2008
Posts: 7
Reputation:
Solved Threads: 0
•
•
•
•
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
Just see the post by Vicky.. Follow his guidelines and that should solve your problem.
Cheers
NRV
![]() |
Other Threads in the ASP Forum
- Previous Thread: How to make a newsletter
- Next Thread: filesystem to HTTP
| Thread Tools | Search this Thread |
archive asp asp.net aspandmssqlserver2005 aspandmssqlserver2005connection aspconnection connection database databaseconnection diagnostics dreamweaver excel fso iis microsoft msmsql mssql2005 mssqlserver2005 mssqlserver2005andasp mssqlserverandasp opentextfile record searchbox selectoption server single specfic sqlserver sqlserverconnection toolkit webserver windows7





