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

cancel button 1

Status
Not open for further replies.

nonprogrammer

Technical User
Joined
Dec 28, 2005
Messages
143
Location
US
I have a javascript

Code:
<script language="JavaScript">
temp= window.prompt ("Please Type Your Name" , "");
if (temp=="")  { window.location="[URL unfurl="true"]http://mywebsite/dontforget.htm";}[/URL] 
</script>
Is there a way to take the cancel button out so it does not show? Only the OK button shows?
 
Is there a way to take the cancel button out so it does not show?

No.



Your only option is to make your own DHTML control if you don't want the cancel button to show. What I'd suggest though, is to code for the event that they click the cancel button - and reshow the prompt again. Something like this:
Code:
<script type="text/javascript">
var a = prompt("test");
while (a == null) {
   a = prompt("test");
}
alert(a);
</script>

-kaht

[small] <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <.</B>[/small]
[banghead] [small](He's back)[/small]
 
word
headbang.gif


-kaht

[small] <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <.</B>[/small]
[banghead] [small](He's back)[/small]
 
you're jealous of my headbanger and my [small]small text[/small]

-kaht

[small] <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <.</B>[/small]
[banghead] [small](He's back)[/small]
 
and besides, you just nabbed up the cone

-kaht

[small] <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <.</B>[/small]
[banghead] [small](He's back)[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top