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!

how ask Yes/No question

Status
Not open for further replies.

fuadhamidov

Programmer
Sep 22, 2003
98
TR
hi

i want to ask the user a Yes/No question.
alert("") has only OK button whereas i want to ask question and the user should approve or not.
is there any way in javascript?
how?
 

Code:
confirm()

Example:
Code:
<a onclick=&quot;confirm( 'Y\'alright, mate?' );&quot;>Test</a>

You should find plenty of examples if you search for them.
 
Just to add to theboyhope's post

using javascript, confirm will return true/false, so you could use:

function testConfirm(){
If(confirm(&quot;Your name is Billy&quot;))
window.location.href=&quot;}
 
simon,

fat fingers or VB habits got you again... &quot;If&quot; should be &quot;if&quot;

function testConfirm(){
if(confirm(&quot;Your name is Billy&quot;))
window.location.href=&quot;}



=========================================================
-jeff
try { succeed(); } catch(E) { tryAgain(); }
 
Jeff,

Thanks Jeff, without you, people on here would be baying for my blood.

It's fat fingers / early morning / mondays / got a cold etc etc

Simon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top