473,379 Members | 1,187 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

Do You Believe in Confirm?

I read in the book Javascript The Definitive Guide by David Flanagan
the following in reference to the use of alert, confirm, and prompt.

"Although these dialog methods are extremely simple and easy to use,
good design dictates that you use them sparingly, if at all. Dialog
boxes like these are not a common feature of the web paradigm, and
they have become much less common now that more capable web browsers
support scripting of the document content itself..."

Do you agree with this statment? If so, let us suppose you want to
confirm a delete operation. How do you go about doing this in a "web-
friendly" way.

Thanks,
Mike

May 11 '07 #1
13 2091
On Fri, 11 May 2007 08:20:25 -0700, MikeC wrote:
I read in the book Javascript The Definitive Guide by David Flanagan the
following in reference to the use of alert, confirm, and prompt.

"Although these dialog methods are extremely simple and easy to use,
good design dictates that you use them sparingly, if at all. Dialog
boxes like these are not a common feature of the web paradigm, and they
have become much less common now that more capable web browsers support
scripting of the document content itself..."

Do you agree with this statment? If so, let us suppose you want to
confirm a delete operation. How do you go about doing this in a "web-
friendly" way.
Yes. I've never used these features. Just a personal preference, not so
much a "you shouldn't do it" opinion.

There's virtually no difference in the code to write a confirmation form
and using the javascript dialog confirmation.

May 11 '07 #2
Daz
On May 11, 4:20 pm, MikeC <mcrav...@att.netwrote:
I read in the book Javascript The Definitive Guide by David Flanagan
the following in reference to the use of alert, confirm, and prompt.

"Although these dialog methods are extremely simple and easy to use,
good design dictates that you use them sparingly, if at all. Dialog
boxes like these are not a common feature of the web paradigm, and
they have become much less common now that more capable web browsers
support scripting of the document content itself..."

Do you agree with this statment? If so, let us suppose you want to
confirm a delete operation. How do you go about doing this in a "web-
friendly" way.

Thanks,
Mike
It depends on who you are and what you are trying to achieve.
Personally, I prefer the look and feel of a floating div, which you
can customise to your hearts content.

Obviously, the class for a customised div would take up considerably
more space that a simple:
var answer = confirm("Continue?");

If your script is seriously simple, or just a simple confirmation for
say, submitting a form, then I believe that the standard confirm
dialog will suffice. If you are writing a much larger, and more
complex script, like https://www.youos.com/ have done for example. I
think that the standard dialog box may look out of place, and a themed
confirmation box might be in order, that perhaps gives more than one
option to choose from.

We also need to take speed into account. Sure, almost everyone on the
internet these days has fast broadband, but there are still lots of
people out there on dialup connections. The more code we write, the
longer it takes them to load a page, and the more agitated they are
likely to become. We can't just shut out these people because it suits
us, can we? Perhaps we can, which brings me back to my original point.
It all depends on what you want to achieve.

Also, one thing to note: With the standard confirm dialog, the browser
is effectively frozen until the process is killed, or the confirmation
dialog has been answered. Sometimes this effect is desirable, other
times, it's not.

Hope I haven't said anything too dumb.

Best wishes.

Daz.

May 11 '07 #3
On May 11, 8:26 am, Ivan Marsh <anno...@you.nowwrote:
On Fri, 11 May 2007 08:20:25 -0700, MikeC wrote:
I read in the book Javascript The Definitive Guide by David Flanagan the
following in reference to the use of alert, confirm, and prompt.
"Although these dialog methods are extremely simple and easy to use,
good design dictates that you use them sparingly, if at all. Dialog
boxes like these are not a common feature of the web paradigm, and they
have become much less common now that more capable web browsers support
scripting of the document content itself..."
Do you agree with this statment? If so, let us suppose you want to
confirm a delete operation. How do you go about doing this in a "web-
friendly" way.

Yes. I've never used these features. Just a personal preference, not so
much a "you shouldn't do it" opinion.

There's virtually no difference in the code to write a confirmation form
and using the javascript dialog confirmation.
Ivan,

I think the objection to using confirm is two-fold. First, it pops up
a dialog which is a normal user interface in non-web applications. But
on the web, people don't like things popping up into separate windows.
The other possible objection - although I don't know this for sure -
is that these are modal controls, meaning that you can't do anything
else until you reply in some way.

How do you handle a confirmation form? Do you display it as another
frame? Thanks for your input.

May 11 '07 #4
On May 11, 8:33 am, Daz <cutenfu...@gmail.comwrote:
On May 11, 4:20 pm, MikeC <mcrav...@att.netwrote:
I read in the book Javascript The Definitive Guide by David Flanagan
the following in reference to the use of alert, confirm, and prompt.
"Although these dialog methods are extremely simple and easy to use,
good design dictates that you use them sparingly, if at all. Dialog
boxes like these are not a common feature of the web paradigm, and
they have become much less common now that more capable web browsers
support scripting of the document content itself..."
Do you agree with this statment? If so, let us suppose you want to
confirm a delete operation. How do you go about doing this in a "web-
friendly" way.
Thanks,
Mike

It depends on who you are and what you are trying to achieve.
Personally, I prefer the look and feel of a floating div, which you
can customise to your hearts content.

Obviously, the class for a customised div would take up considerably
more space that a simple:
var answer = confirm("Continue?");

If your script is seriously simple, or just a simple confirmation for
say, submitting a form, then I believe that the standard confirm
dialog will suffice. If you are writing a much larger, and more
complex script, likehttps://www.youos.com/have done for example. I
think that the standard dialog box may look out of place, and a themed
confirmation box might be in order, that perhaps gives more than one
option to choose from.

We also need to take speed into account. Sure, almost everyone on the
internet these days has fast broadband, but there are still lots of
people out there on dialup connections. The more code we write, the
longer it takes them to load a page, and the more agitated they are
likely to become. We can't just shut out these people because it suits
us, can we? Perhaps we can, which brings me back to my original point.
It all depends on what you want to achieve.

Also, one thing to note: With the standard confirm dialog, the browser
is effectively frozen until the process is killed, or the confirmation
dialog has been answered. Sometimes this effect is desirable, other
times, it's not.

Hope I haven't said anything too dumb.

Best wishes.

Daz.
Daz,

Yes I suspected the answer was not a simple aye or nay. I'm new to web
programming and don't exactly know what a floating div is. Since this
is a forum on Javascript and not on HTML, it might be inappropriate to
even ask what it is. I presume it must be a div section that is
capable of appearing anywhere within a document as well as
disappearing. If you would be so kind as to point me in the right
direction as to how to accomplish this, I would be very grateful.

May 11 '07 #5
Daz
On May 11, 4:36 pm, MikeC <mcrav...@att.netwrote:
On May 11, 8:26 am, Ivan Marsh <anno...@you.nowwrote:
On Fri, 11 May 2007 08:20:25 -0700, MikeC wrote:
I read in the book Javascript The Definitive Guide by David Flanagan the
following in reference to the use of alert, confirm, and prompt.
"Although these dialog methods are extremely simple and easy to use,
good design dictates that you use them sparingly, if at all. Dialog
boxes like these are not a common feature of the web paradigm, and they
have become much less common now that more capable web browsers support
scripting of the document content itself..."
Do you agree with this statment? If so, let us suppose you want to
confirm a delete operation. How do you go about doing this in a "web-
friendly" way.
Yes. I've never used these features. Just a personal preference, not so
much a "you shouldn't do it" opinion.
There's virtually no difference in the code to write a confirmation form
and using the javascript dialog confirmation.

Ivan,

I think the objection to using confirm is two-fold. First, it pops up
a dialog which is a normal user interface in non-web applications. But
on the web, people don't like things popping up into separate windows.
The other possible objection - although I don't know this for sure -
is that these are modal controls, meaning that you can't do anything
else until you reply in some way.

How do you handle a confirmation form? Do you display it as another
frame? Thanks for your input.
The method I've seen a lot of is called a "lightbox" (see
http://www.huddletogether.com/projects/lightbox/ for information and a
demo). It's basically a floating div, that is centered on the page,
when it is displayed, it places another full page div underneath it,
which covers the page contents, which can prevent the user from
clicking on any links on the page, or highlighting text etc, until the
confirmation has been confirmed. The main trouble with such dialogs
are that it's not always easy to make it work across all platforms.
Although I believe that they have it sussed pretty well, as browsers
change, so will the lightbox. With a standard confirmation dialog, you
know it's going to work straight out of the box with all browsers that
have JavaScript enabled.

Also, with the lightbox, the user can still hit refresh, and possibly
lose anything that was being worked on (like a form they were filling
out). I know that there are methods to prevent page refreshes, but I
think that these hacks only work for the later versions of IE, and
Firefox, however, I am not certain.

Remember: KISS :)

Daz

May 11 '07 #6
Daz
On May 11, 4:45 pm, MikeC <mcrav...@att.netwrote:
On May 11, 8:33 am, Daz <cutenfu...@gmail.comwrote:
On May 11, 4:20 pm, MikeC <mcrav...@att.netwrote:
I read in the book Javascript The Definitive Guide by David Flanagan
the following in reference to the use of alert, confirm, and prompt.
"Although these dialog methods are extremely simple and easy to use,
good design dictates that you use them sparingly, if at all. Dialog
boxes like these are not a common feature of the web paradigm, and
they have become much less common now that more capable web browsers
support scripting of the document content itself..."
Do you agree with this statment? If so, let us suppose you want to
confirm a delete operation. How do you go about doing this in a "web-
friendly" way.
Thanks,
Mike
It depends on who you are and what you are trying to achieve.
Personally, I prefer the look and feel of a floating div, which you
can customise to your hearts content.
Obviously, the class for a customised div would take up considerably
more space that a simple:
var answer = confirm("Continue?");
If your script is seriously simple, or just a simple confirmation for
say, submitting a form, then I believe that the standard confirm
dialog will suffice. If you are writing a much larger, and more
complex script, likehttps://www.youos.com/havedone for example. I
think that the standard dialog box may look out of place, and a themed
confirmation box might be in order, that perhaps gives more than one
option to choose from.
We also need to take speed into account. Sure, almost everyone on the
internet these days has fast broadband, but there are still lots of
people out there on dialup connections. The more code we write, the
longer it takes them to load a page, and the more agitated they are
likely to become. We can't just shut out these people because it suits
us, can we? Perhaps we can, which brings me back to my original point.
It all depends on what you want to achieve.
Also, one thing to note: With the standard confirm dialog, the browser
is effectively frozen until the process is killed, or the confirmation
dialog has been answered. Sometimes this effect is desirable, other
times, it's not.
Hope I haven't said anything too dumb.
Best wishes.
Daz.

Daz,

Yes I suspected the answer was not a simple aye or nay. I'm new to web
programming and don't exactly know what a floating div is. Since this
is a forum on Javascript and not on HTML, it might be inappropriate to
even ask what it is. I presume it must be a div section that is
capable of appearing anywhere within a document as well as
disappearing.
A floating div is exactly what you might think. It's a div element,
that floats. Hehe. When you float a div, it's effectively standalone,
and can be postitioned according to the boundaries of it's parent
element, or the window element, in fact, any element you want. When
you float a div, it will be positioned using absolute positioning. It
won't automatically fit to the size of the parent element, so the
boundaries of the floating div can overlap the boundaries of any other
elements on the page.

On top of all of this, you need to specify the z-index of the element.
Z-index is the order of the layers. The higher the number of the
index, the closer to the top it will be.

An element with a z-index of say, 100, will appear on top of any
elements with a lower z-index. If you have anymore questions, feel
free to ask, but remember that Google is your best friend.

To anyone else, if I am wrong in any way, please correct me. I haven't
been programming in JavaScript for very long, but I think I understand
many of the concepts.
If you would be so kind as to point me in the right
direction as to how to accomplish this, I would be very grateful.
Done! Please see above :)

May 11 '07 #7
On May 11, 8:51 am, Daz <cutenfu...@gmail.comwrote:
On May 11, 4:36 pm, MikeC <mcrav...@att.netwrote:


On May 11, 8:26 am, Ivan Marsh <anno...@you.nowwrote:
On Fri, 11 May 2007 08:20:25 -0700, MikeC wrote:
I read in the book Javascript The Definitive Guide by David Flanagan the
following in reference to the use of alert, confirm, and prompt.
"Although these dialog methods are extremely simple and easy to use,
good design dictates that you use them sparingly, if at all. Dialog
boxes like these are not a common feature of the web paradigm, and they
have become much less common now that more capable web browsers support
scripting of the document content itself..."
Do you agree with this statment? If so, let us suppose you want to
confirm a delete operation. How do you go about doing this in a "web-
friendly" way.
Yes. I've never used these features. Just a personal preference, not so
much a "you shouldn't do it" opinion.
There's virtually no difference in the code to write a confirmation form
and using the javascript dialog confirmation.
Ivan,
I think the objection to using confirm is two-fold. First, it pops up
a dialog which is a normal user interface in non-web applications. But
on the web, people don't like things popping up into separate windows.
The other possible objection - although I don't know this for sure -
is that these are modal controls, meaning that you can't do anything
else until you reply in some way.
How do you handle a confirmation form? Do you display it as another
frame? Thanks for your input.

The method I've seen a lot of is called a "lightbox" (seehttp://www.huddletogether.com/projects/lightbox/for information and a
demo). It's basically a floating div, that is centered on the page,
when it is displayed, it places another full page div underneath it,
which covers the page contents, which can prevent the user from
clicking on any links on the page, or highlighting text etc, until the
confirmation has been confirmed. The main trouble with such dialogs
are that it's not always easy to make it work across all platforms.
Although I believe that they have it sussed pretty well, as browsers
change, so will the lightbox. With a standard confirmation dialog, you
know it's going to work straight out of the box with all browsers that
have JavaScript enabled.

Also, with the lightbox, the user can still hit refresh, and possibly
lose anything that was being worked on (like a form they were filling
out). I know that there are methods to prevent page refreshes, but I
think that these hacks only work for the later versions of IE, and
Firefox, however, I am not certain.

Remember: KISS :)

Daz- Hide quoted text -

- Show quoted text -
Daz,

This looks like a great alternative. Thanks a bunch.

May 11 '07 #8
MikeC <mc******@att.netwrote in news:1178896825.556152.327040
@o5g2000hsb.googlegroups.com:

Do you agree with this statment? If so, let us suppose you want to
confirm a delete operation. How do you go about doing this in a "web-
friendly" way.
Personally, I think there is a place for it. As you mention, all my
delete/"serious" background operations depend on a javascript confirm by
the user.

I feel its appropriate, easy, and fits in with web applications - its a lot
like a 'system' dialog, and hence i use it on 'system'-type operations
(deleting files, granting specialized access etc).

I try to avoid hard-and-fast rules of any sort for programming, there are
so many variations.

Why replicate the function of a javscript confirm in a <div>? It's still a
"pop-up", not to mention you now have extra HTML to download. Why not take
the simple, proven, lightweight option? Why embrace certain parts of
javascript and decry others?
May 11 '07 #9
Daz
On May 11, 5:10 pm, Good Man <h...@letsgo.comwrote:
MikeC <mcrav...@att.netwrote in news:1178896825.556152.327040
@o5g2000hsb.googlegroups.com:

Why replicate the function of a javscript confirm in a <div>? It's still a
"pop-up", not to mention you now have extra HTML to download. Why not take
the simple, proven, lightweight option? Why embrace certain parts of
javascript and decry others?
Simple:

Customisability (if that's even a word)
To change the behavior of something
Aesthetics
An attempt to enhance user experience and usability (Although this
quite often fails)

I think on the Web today, there are many Web sites that are very
plain. For people like us, who develop, these kinds of sites are
fantastic. They display the information we require in a clear and
concise way. By keeping it plain and simple, means that we developers
don't have to curse so much.

On the other hand, to non-developers, Web sites are very much like
food. You eat with your eyes. If you like what you see, and enjoy
using it, it's something you won't forget, and your visitors will most
likely return, and possibly bring more users with them. By giving
users something they've never seen or experienced before, or just by
trying to be unique, you are going to get a lot of visitors.

My example earlier, was www.youos.com . I suggest you check it out.
It's a very good example of that can be achieved with JavaScript. Do
we have any use for it? No not really, but for the average Joe, I am
pretty sure it's priceless. To my knowledge, YouOS has been around for
some years, and is still undergoing development. To me this suggests 1
of two things. The developers are fixated with the idea, and just
can't stop scripting it, or it's quite popular among normal users. I
think it's the latter. :)

What we "really" need, is a customisable standard confirmation dialog.
This way we can have something other than "yes" or "no". Will it ever
become a standard? Ha! I'll answer that with another question. Do
Microsoft know the meaning of the word "free" or "open-source"?

The Web is evolving fast, and their are many people who are fixated on
keeping everything simple, and not taking advantage of the new
functionality and techniques that are available. Whilst I don't
disagree with this way of looking at it one bit (we all know that
simplicity provails), my "preference", is to be creative, and move
with the times.
May 11 '07 #10
Lee
Good Man said:
>Why embrace certain parts of javascript and decry others?
Is that a serious question?
--

May 11 '07 #11
MikeC wrote:
Let us suppose you want to confirm a delete operation.
How do you go about doing this in a "web-friendly" way.
Another problem with the confirm approach is that your user's options
are limited to "OK" and "Cancel". In the case of deleting something, a
more user-friendly confirmation "dialog" would have perhaps "Yes" and
"No" options: (Are you sure you wish to delete this? [Yes] [No]).

Or consider when you are editing something and you go to close it. Most
apps give you three options, when it asks if you want to save changes.
Yes, No, and Cancel.

None of these are possible with a JavaScript confirm() dialog. Using a
floating div/"lightbox" approach as mentioned in this thread is a great
way to achieve this.
May 11 '07 #12
On Fri, 11 May 2007 10:40:14 -0700, Lee wrote:
Good Man said:
>>Why embrace certain parts of javascript and decry others?

Is that a serious question?
I think this just became a GOTO discussion.

May 11 '07 #13
Daz <cu********@gmail.comwrote in
news:11**********************@y80g2000hsf.googlegr oups.com:
On May 11, 5:10 pm, Good Man <h...@letsgo.comwrote:
>MikeC <mcrav...@att.netwrote in news:1178896825.556152.327040
@o5g2000hsb.googlegroups.com:

Why replicate the function of a javscript confirm in a <div>? It's
still a "pop-up", not to mention you now have extra HTML to download.
Why not take the simple, proven, lightweight option? Why embrace
certain parts of javascript and decry others?

Simple:

Customisability (if that's even a word)
To change the behavior of something
Aesthetics
An attempt to enhance user experience and usability (Although this
quite often fails)

What we "really" need, is a customisable standard confirmation dialog.
This way we can have something other than "yes" or "no".
good post, and yes, i have wished for such a thing often.
May 11 '07 #14

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Logger | last post by:
Help, I’m trying to implement a confirm button on an asp.net page. I have it attached to a asp:button control. In the button1 click event I call the CreateConfirmBox subroutine. The Box comes...
0
by: Joe Finsterwald | last post by:
Recently I needed to add a confirm to a LinkButton that called a JavaScript function on success, and did nothing on failure. I found documentation on adding a confirm, but not on how to place a...
13
by: Chris | last post by:
I can create Javascript confirm message boxes during page creation, etc adding them to the button attributes (many good posts on this!). But how can I add this event after the button is pressed? I...
1
by: freshRecruit | last post by:
Hi, I am having a problem, and is driving me nuts and my deadline is fast approaching. Please do help me.. This is a webapplication with a usercontrol which has some buttons for adding,...
1
by: chris | last post by:
Hi, In ASP.NET page, when my user tries to edit a record in gridview, I need to display a confirmation message, if another user is editing the same record. Since the confirmation message will...
4
by: tfsmag | last post by:
Okay, I have a project management app i'm writing and in the left hand menu i have a treeview control that is populated with each project... in child nodes under each project node I have an "edit"...
8
by: rn5a | last post by:
I have gone through a no. of posts in this NewsGroup regarding my problem but alas, couldn't come across one which would have helped me in resolving the issue. My problem is this: An ASPX Form...
5
by: strikefiend | last post by:
Ok, I'm somewhat new to .NET C# language and am having a bit of trouble. I'm trying to run the javascript confirm() method from my ascx page but I'm currently using C# as the main language of the...
4
by: mamun | last post by:
Hi All, I have the following situation and am looking for answer in C#. I have a datagrid and putting checkbox next to each record. In the header I have a Delete button. I want users to...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.