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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

command prompt 2

Status
Not open for further replies.

estesflyer

Programmer
Dec 19, 2000
284
US
<script language=&quot;javascript&quot;>
<!--
var name=window.prompt(&quot;plz give me your name&quot;,&quot;Fred&quot;);
window.confirm(&quot;Is &quot; + name + &quot; correct?&quot;);
//-->
</script>

how can i make it to be when the user enters his/her name, then the command box comes up, when he clicks ok in the command prompt box, a certain line of code is run, but if he clicks cancel, than a different line of code will be run

 
c = window.confirm(&quot;Is &quot; + name + &quot; correct?&quot;);

if (c)
{
alert(&quot;i'm glad that is correct&quot;);
}
else
{
prompt(&quot;Well, what is it then?&quot;, &quot;&quot;);
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top