User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 427,227 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,224 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 579 | Replies: 2
Reply
Join Date: Feb 2008
Posts: 9
Reputation: themailsian is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
themailsian themailsian is offline Offline
Newbie Poster

Prolem in Delete Confirmation

  #1  
Jul 14th, 2008
Dear All,

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

i m using this code:
<script LANGUAGE="JavaScript">

function confirmSubmit()
{
var agree=confirm("Are you sure you wish to continue?");
if (agree)
	return true ;
else
	return false ;
	
}

</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 10:12 pm. Reason: Added code tags
Needo
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Nov 2007
Location: Arkansas
Posts: 399
Reputation: buddylee17 will become famous soon enough buddylee17 will become famous soon enough 
Rep Power: 2
Solved Threads: 78
buddylee17's Avatar
buddylee17 buddylee17 is online now Online
Posting Whiz

Re: Prolem in Delete Confirmation

  #2  
Jul 14th, 2008
What about just doing something like:
<a href="delete.asp" onclick="return confirm('Are you sure you wish to continue?')">Delete</a>
Or, if you need a function for several links:
  1. <script type="text/javascript">
  2. function confirmSubmit(){
  3. return confirm('Are you sure you wish to continue?');
  4. }
  5. </script>
  1. <a href="delete.asp" onclick="return confirmSubmit();">Delete</a>
Last edited by buddylee17 : Jul 14th, 2008 at 9:37 am.
Lost time is never found again.
- Benjamin Franklin
Reply With Quote  
Join Date: Jul 2008
Location: Sweet India
Posts: 828
Reputation: Shanti Chepuru is on a distinguished road 
Rep Power: 2
Solved Threads: 74
Shanti Chepuru's Avatar
Shanti Chepuru Shanti Chepuru is offline Offline
Practically a Posting Shark

Re: Prolem in Delete Confirmation

  #3  
Jul 16th, 2008
Try like this:
  1. <script language="JavaScript" type="text/javascript">
  2. var d = document.form1;
  3. function del(x)
  4. {
  5. if(confirm("You want to delete this record"))
  6. {
  7. d.submit();
  8. }
  9.  
  10. return;
  11. }
  12. </script>
Be intelligent, But Don't try to cheat.. Be innocent But Don't get cheated..
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb JavaScript / DHTML / AJAX Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 11:36 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC