Free Web Hosting PHP/mySQL
GlobalWeb.com.ru Forum Index GlobalWeb.com.ru
Free Web Hosting :: Commercial Web Hosting :: PHP/mySQL :: CGI/Perl
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

alert dialog box

 
Post new topic   Reply to topic    GlobalWeb.com.ru Forum Index -> Javascript
Author Message
che100



Joined: 28 Feb 2004
Posts: 20
Location: Lebanon

PostPosted: Mon Mar 01, 2004 1:03 am    Post subject: alert dialog box Reply with quote

<HTML><HEAD>
<TITLE>Alert Dialog Box</TITLE>
<SCRIPT LANGUAGE="JavaScript">
<!-- Hide from JS-Impaired Browsers
function testIt(){
str=document.ug.ly.value;
/* First, if no entry, give an alert
and then move cursor to form
element with focus() call. */
if (str.length<1){
alert("Please enter a user name so"
+" that we can continue");
document.ug.ly.focus();
}
else{
/* Next, if entry too short, give
an alert and then move cursor to
form element with focus() call,
and then a select() call to
highlight it. */
if (str.length!=6){
alert("Please enter a user name that"
+" is exactly 6 characters long.");
document.ug.ly.focus();
document.ug.ly.select();
}
else{
/* Process the rest of form here. Just
so you can see it accepts 6 letter
names, the next line is included in
this script. */
alert("You typed exactly six letters!"
+" The name you entered is "+str);
}
}
}
// End Hiding -->
</SCRIPT>
</HEAD>
<BODY BGCOLOR="white">
<CENTER><P>
<B>JavaScript Alert Dialog Box</B>
<P><TABLE BORDER=0 WIDTH=490>
<TR><TD>Click the Submit button without typing a name, then type a name less than 6 characters, then one longer than 6 characters and finally one exactly six characters long, clicking on the Submit button after each.</TD></TR>
</TABLE>
<P><FORM NAME="ug">
Six Character User Name: <INPUT TYPE="text" NAME="ly">
<INPUT TYPE="button" NAME="but" VALUE=" Submit " onClick="testIt()">
</FORM>
</BODY>
</HTML>
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
sam
Banned


Joined: 01 Mar 2004
Posts: 51
Location: IL

PostPosted: Mon Mar 01, 2004 1:24 pm    Post subject: Reply with quote

Howtos
_________________
Back to top
View user's profile Send private message Visit poster's website
macabist
Banned


Joined: 01 Mar 2004
Posts: 35

PostPosted: Mon Mar 01, 2004 1:33 pm    Post subject: Reply with quote

isn't it simpler to write
window.alert();
?
Back to top
View user's profile Send private message
sam
Banned


Joined: 01 Mar 2004
Posts: 51
Location: IL

PostPosted: Mon Mar 01, 2004 1:38 pm    Post subject: Reply with quote

yes i think so!
_________________
Back to top
View user's profile Send private message Visit poster's website
macabist
Banned


Joined: 01 Mar 2004
Posts: 35

PostPosted: Mon Mar 01, 2004 1:43 pm    Post subject: Reply with quote

alright
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    GlobalWeb.com.ru Forum Index -> Javascript All times are GMT
Page 1 of 1

 


Free Web Hosting, Commercial Web Hosting, PHP/mySQL Copyright © 2009
Free Scripts Directory | Free Software Downloads | Newsgroups Directory | Optel.net | Mirroraty | Cruised.net | Hardware Keylogger