• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
Bartenders:
  • Piet Souris
  • Jj Roberts
  • fred rosenberger

displaying a confirmation box

 
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How do I display a confirmation dialog box .. for example if the user after filling his form , if the user clicks on the submit button a confirmation dialog box occurs whether he wants to add the record or not. if he clicks on yes ..the page further proceeds.. if he clicks on no..the form is reset..
do we use .. window.confirm() for the same..
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You need to do two things
1. On the submit form, you need to call a function as
<FORM name="xyz" onsubmit="return yourfnname()">
You have to write the code in onsubmit of the form and not onclick of the button which you are pressing.
2. In yourfnname(), you have to add the following code :
function yourfnname(){
if(confirm("Do you want to Submit the data")== true){
// If some processing needs to be done, do it here
return true;
}
return false;
}
 
jyotsana dang
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
can we add two function with onSubmit event..
like adding a validating func. and a confirmation one..
 
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello joystana,
U can call two or more methods onSubmit event .
please read this link which Iam sending
http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/objects.asp
please read this link always and it has all the info for the javascript and html.
Thanks

follow my advice dear.
 
jyotsana dang
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Jasmine kaur:
Hello joystana,
U can call two or more methods onSubmit event .
please read this link which Iam sending
http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/objects.asp
please read this link always and it has all the info for the javascript and html.
Thanks

follow my advice dear.


thanks maam..and may ur life flower like a jasmine..
shall always follow ur advice..
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic