Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

window.confirm default to Cancel button

Status
Not open for further replies.

maxpower1

Programmer
Jul 29, 2001
488
US
hi there,
I need to default the focus on the Cancel button instead of OK to prevent some 'fat fingering'. Any advice is appreciated on how to accomplish this.

thanks

~za~
You can't bring back a dead thread!
 
There's nothing in my O'Reilly reference about this. If I was really keen on doing that, I would either create my own pop-up that mimicked a confirm box or I would change my question around so that hitting 'OK' was the way to back out of submitting.

For example, instead of: "Is this information correct? Press 'OK' to continue. Press 'Cancel' to edit your values", you could write: "Would you like to edit these values? Press 'OK' to return to the form. Press 'Cancel' to continue."

The second idea is much less-convincing to a user, however. The first method requires a little programming to get it to work just right (but it DOES allow you to label your buttons the way you want).

Obviously, the third alternative is to let the fat-fingered user beware. Are the results that dramatic if they accidentally hit 'OK' when they meant to hit 'Cancel'?

Perhaps you could add a SECOND confirm box with an "Are you sure?"-style question as a just-in-case measure.

--Dave
 
thanks for the reply. I let you know if I find anything.

>Are the results that dramatic if they accidentally hit 'OK' when they meant to hit 'Cancel'?

The web-based app that I wrote is used to move heavy items (a couple of thousand lbs each) by cranes. It's an equipment-managed app. Yes the aftermath is dramatic. ;)

thanks again.

~za~
You can't bring back a dead thread!
 
throw up another confirm to give the user one more chance to back out

__________________________________________________________
"The only difference between me and a mad man is that I'm not mad."
- Dali
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top