Guide to creating simple chromeless popup windows.

Written by Michael Bloch


Continued from page 1

You can change width and height to suit, but don't make it too narrow, otherwise site visitors will need to scroll horizontally to viewrepparttar content. Too wide a setting will coverrepparttar 119125 majority ofrepparttar 119126 screen area for those users still running 640x480 resolution.

When copying scripts likerepparttar 119127 one above, ensure you paste it into Notepad first; then copy it again and transfer it to your HTML. Copying and pasting code straight from a web page can produce some pretty weird results.

Next,repparttar 119128 hyperlink to use to engagerepparttar 119129 script (Changerepparttar 119130 properties in capital letters to suit):

CLICK HERE

Done!

If you are looking for a script to create an automated site entry or site exit popup window, check out our free javascript code generators section, specifically:

http://www.tamingthebeast.net/scripts/windowsframesjavascripts.htm

but, use with caution - I don't know many visitors who upon entering a site and seeing a popup window yell, "whoopeee!!!"

Michael Bloch  michael@tamingthebeast.net  http://www.tamingthebeast.net Tutorials, web content and tools, software and community. Web Marketing, eCommerce & Development solutions. _____________________________________________ 

Copyright information....If you wish to reproduce this article, please acknowledge "Tamingrepparttar 119131 Beast" by including a hyperlink or reference torepparttar 119132 website (www.tamingthebeast.net) & send me an email letting me know. The article must be reproduced in it's entirety & this copyright statement must be included. Thanks. Visit www.tamingthebeast.net to view other great articles FREE for reproduction!

Michael is an Australian Information Technologies trainer and web developer. Many other free web design, ecommerce development and Internet articles, tutorials, tools and resources are available from his award winning site; Taming the Beast.net (http://www.tamingthebeast.net)


Validating Form Input in JavaScript

Written by Amrit Hallan


Continued from page 1

Copy and pasterepparttar code as it is, and saverepparttar 119124 entire content as a new HTML page. Then load it on to your browser. Unless you seerepparttar 119125 result, it'll be difficult to followrepparttar 119126 script if you do not have prior programming background. The first condition is, none ofrepparttar 119127 fields can be submitted blank. Click onrepparttar 119128 submit button without entering anything and observerepparttar 119129 reaction.

Here, we are making ample use ofrepparttar 119130 recently learnt for(){.} loop. Then we have used function too, to carry out certain validations. Our main function, checkfields(), is associated withrepparttar 119131 OnClick attribute ofrepparttar 119132 "Submit" button, that is, when you click onrepparttar 119133 "Submit" button, this function gets triggered.

Some new terms in today's script are: true, false, charAt(), toString(), break, indexOf(), string.length, and orm.elements[ ].

A quick explanation to make things easier:

If at 10:30 pm, I say, "It is night", then

var fact='true'

and if I say at 10:30 pm that "It's afternoon", then

var fact='false'

Which explainsrepparttar 119134 use of true and false, which are also called Boolean operators, which means, a Boolean variable can either be true or false, but NEVER both.

Until we learn about arrays, every character in a string has an index position. For instance, if we have

var city="Delhi"

then city.charAt(0)="D", city.charAt(1)="e", city.charAt(2)="l"...city.charAt(4)="i".

toString(), converts another data type to a string data-type. For example,

var num1=31 var num2=21 var char1=num1.toString() var char2=num2.toString()

So,

num1+num2=52 and char1+char2=3221

Inrepparttar 119135 second case, instead of being added,repparttar 119136 variables are being concatenated, which indicates that they are strings, not numbers. We'll see its application later.

break, true to its name, breaks something. In this case, it breaksrepparttar 119137 loop in which it occurs, and takesrepparttar 119138 execution ofrepparttar 119139 program torepparttar 119140 line immediately afterrepparttar 119141 loop, without meetingrepparttar 119142 condition required to completerepparttar 119143 loop.

indexOf() tells us aboutrepparttar 119144 position of a particular character in a string. Look its use inrepparttar 119145 following code:

var city="Delhi"

Referring to this code, city.indexOf("e") should give us a value 1 and city.indexOf("h") should give us a value 3. city.indexOf("z") should give us a value less than zero, indicating that it does not belong torepparttar 119146 given string.

String.length gives usrepparttar 119147 length ofrepparttar 119148 string, for instance, if city="Delhi", then city.length would give us 5.

Again, elements[ ] is an array, and we haven't dealt with them yet, so we leaverepparttar 119149 rest ofrepparttar 119150 explanation torepparttar 119151 next section.

Amrit Hallan is a freelance web designer. For all web site development and web promotion needs, you can get in touch with him at amrit@bytesworth.com or http://www.bytesworth.com. For more such articles, visit http://www.bytesworth.com/articles You can subscribe to his newsletter [BYTESWORTH REACHOUT] on Web Designing Tips & Tricks by sending a blank email at bytesworth-subscribe@topica.com


    <Back to Page 1
 
ImproveHomeLife.com © 2005
Terms of Use