Client Side Things
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesClient Side Things

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old January 7th, 2004, 02:56 AM
CodeKadiya CodeKadiya is offline
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: Colombo,Sri Lanka
Posts: 2,313 CodeKadiya User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 4
Send a message via Yahoo to CodeKadiya
Confirm dialog box

I want to know how to make a confirm alert dialog box before submitting a form. I think it is something to be done with VBscript. But, I have no idea of how to code it in the page. Can someone give me a simple example of how to create a alert box something like:
"Are you sure you want to delete selected items?" with Yes, No buttons in it. And I want to know how to know the option user has selected for the question we provide them. Thanks for your attention!

Reply With Quote
  #2  
Old January 7th, 2004, 07:26 AM
coderboi coderboi is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 80 coderboi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: Confirm dialog box

OK - here's one way to do it using Javascript... you should be able to modify the code easily enough to suit you

Code:
<script language="javascript">

function getconfimation()
  {
  var yousure = confirm("Are you sure you want to delete selected items?");
  if (yousure == true)
    {
    // They've selected 'Yes' so submit the form    
    document.formname.submit();
    }
  else
    {
    // do something else - they've selected 'No'
    }
  }


Then, instead of a submit button at the end, use something like this:

Code:
<a href="#" onclick="getconfirmation()">Delete Selected Items</a>


hope this helps

Reply With Quote
  #3  
Old January 7th, 2004, 08:39 AM
CodeKadiya CodeKadiya is offline
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: Colombo,Sri Lanka
Posts: 2,313 CodeKadiya User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 4
Send a message via Yahoo to CodeKadiya
RE: Confirm dialog box

It did the job clamly! I appriciate your answer!

You can even have a submit button. Then you need to call your function like this:
<form onSubmit="retur getconfirmation()">

<script language="javascript">

function getconfimation()
{
var yousure = confirm("Are you sure you want to delete selected items?");
if (yousure)
return true;
else
return false;
}


Both the same! Thread resolved!

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesClient Side Things > Confirm dialog box


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT