Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 19th, 2005, 02:18 PM
Registered User
Join Date: May 2005
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Javascript Confirm dialog difficulty

Ok, this one is baffling me.

We're writing a web app, and every time a user clicks any control on the page, we are disabling all the other controls via Javascript so as to keep people from double-clicking. However, on one page, one button must do an additional task: display a confirmation dialog and then disable all the controls on the form (although any order would work). For example:

onClick = "if(Confirm('CommitDeleteButton','','Are you sure you want to delete this record?','','')) { DisableForm(); return true; } else { return false; }"

The form gets disabled but never posts, which means that return true is never reached. Does this happen because the control is disabled? The code must stay in the onclick event and cannot employ any other scripts elsewhere. Any ideas?
Reply With Quote
  #2 (permalink)  
Old May 20th, 2005, 03:34 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts

Is this code in the onclick of the submit button? If so the return value won't do anything, to be effective it must be in the onsubmit handler.
Why must all code be inline in the handler rather than calling a function, it's much harder to debug and maintain?


Joe (Microsoft MVP - XML)
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Javascript confirm box with just an 'OK' button crmpicco Javascript How-To 28 March 12th, 2014 06:44 AM
Difficulty writing javascript to access dom ldoyle Javascript How-To 2 February 23rd, 2007 11:25 AM
JavaScript Confirm Box ricespn Classic ASP Basics 1 January 20th, 2007 12:48 AM
"confirm" dialog before processing dropdown event glandgraf@gocfi.com .NET Framework 2.0 1 March 21st, 2005 11:58 AM
need Confirm() with Yes/No buttons in JavaScript ehelpcornet ASP.NET 1.0 and 1.1 Basics 1 June 3rd, 2004 07:32 AM

All times are GMT -4. The time now is 03:43 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.