• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JavaScript

 
satish polasi
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
While giving alert to the user using javascript we have two buttons ok and cancel buttons, by default ok is selected, how to make cancel button by default.
please help me..

thanks
satish
 
Rajesh Kumar
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The last time i checked this is not possible for the confirm
JS function
Here are some possible alternatives:
-creating your own custom popup layer(dhtml) to emulate confirm-dialog
that does the same thing and including the script into all your pages
-just pop-up a new 'small' browser window to do the confirm

just my 2 cents.
-Rajesh
 
Amit KumarS
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi..
you can write a line in onLoad() method as
document.<formname>.<buttonname>.focus()
Let me if ur needs are fulfilled
Thnaks
Amit
 
Mathias Nilsson
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The above code won't work since the alert button Ok and cancel doesn't have
a name.
// Mathias
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65216
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This has nothing to do with Servlets. I've requested a move to the HTML forum.
bear
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As said before, you can not make it default. Either you need to make yourown with layers, or just deal with the cancel button.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic