Page 1 of 1

javascript confirm() change focus

Posted: Tue Jun 08, 2004 9:33 pm
by valen53
since we know that the confirm function was foucs on the OK button. can we change the focus to Cancel button after popup?
b'cos some user was too fast to enter the button without reading, then some misunderstand was occur.

after search, but still can't found solution, anybody can help me?

var agree=confirm("Are you sure you wish to continue?");
if (agree)
return true ;
else
return false ;
}

Posted: Tue Jun 08, 2004 9:56 pm
by feyd
AFAIK, it's a system built and controlled message box, so no.

Posted: Tue Jun 08, 2004 9:57 pm
by feyd
An alternative would be creating an in-page confirm box, either through Javascript or php. I'd suggest using php for compatibility reasons..

Posted: Tue Jun 08, 2004 10:09 pm
by Weirdan
Can't you rephrase the question? something like:

Code: Select all

var agree = confirm("Do you want to read license agreement once more?");
if (agree)
  return false ;
else
  return true ;

Posted: Tue Jun 08, 2004 11:27 pm
by valen53
thanks for all reply...

i will ask my users either use confirm() or in-page confirm box