Goodies to Go (tm)
May 26, 2003-- Newsletter #234

By Vince Barnes



Goodies to Go (tm)
May 26, 2003--Newsletter #234

This newsletter is part of the internet.com network.
http://www.internet.com
 


Featured this week:

* Goodies Thoughts - Date Palms or Date Parms?
* Q & A Goodies
* News Goodies
* Goodies Peer Reviews
* Feedback Goodies  
* And Remember This...

 


 

Goodies Announcement

Just in case you missed it before, the new Beyond HTML Goodies book is now available!

 

Go beyond the basics and learn how the pros add and use dynamic HTML features and advanced JavaScript techniques. Beyond HTML Goodies demonstrates dozens of new and different features readers can add to their existing Web pages using HTML and JavaScript. The book starts with simple text and image tips, such as adding a clock to a Web page or causing text to appear when the mouse moves over an image. It gradually builds to more complex tricks, including manipulating forms or working with cookies behind the scenes. Throughout the book, readers enjoy Joe's snappy style and "to the point" discussion of each "goody" in the book.

 

http://books.internet.com/books/0789727803

 

 

Goodies Thoughts - Date Palms or Date Parms?



"It's Tuesday," you're probably saying to yourself, "why am I receiving my Goodies To Go today instead of yesterday? It usually comes every Monday." "A good question;" I would respond, had you said it out loud and to me, "there is an explanation. Yesterday was a Holiday -- Memorial Day."  "What day?" you say. I had forgotten that you are in Norway; yesterday wasn't a holiday in Norway. In the UK it was the Spring Bank Holiday, which doesn't mean too much in the USA, but in Norway it was the day after Sunday.

This all goes to highlight a problem that is at the root of an important web design consideration. We must never forget what corner of the world we are in, and what other corner of the world our audience may be in. If you are designing a website strictly for the use of your fellow countryfolk, then you probably know all the customs and traditions that you need to bear in mind. It may be worth considering, however, how confusing your site might be to a visitor from foreign parts. "WWW" is, after all, the "World Wide" Web!

Think about 7/4, for example. "Independence Day!" whoop our American readers right away, while across the ocean our British readers ask "what's so special about the seventh of April?" Independence Day is the fourth of July. Not only must we remember that the fourth of July doesn't mean anything much anywhere except in the USA, but that the date itself is written down differently in different parts of the world. If you use the numerical representation of a date, you are likely to cause confusion somewhere, at least part of the time (12/24 might be clear to everybody, even if they would normally write 24/12.) While our Norwegian reader might write the twenty-fourth of July "24-7", that might well be interpreted by an American as "twenty-four hours a day, seven days a week," which just adds to the confusion.

Dates are one example, time is another, and currency another. Tradition also has a part to play. In the USA, "with" is frequently abbreviated to "w/", which doesn't mean anything to the English, except those that have adopted American habits (our Norwegian, however, will often abbreviate "med" to "m/".) Why so short a word needs abbreviating I'm not quite certain!

Having identified the problem, the most useful thing for me to do would be to provide you with the solution. Unfortunately in this case, it's not quite so simple. The problem here changes with who you are, and who your audience is. While the problem may never quite go away, it can be diminished by a little careful thought on the part of the designer. Dates expressed in words, for example, are less likely to be misinterpreted than those expressed numerically. If you use things from your own culture, religion or tradition, and you are targeting a global audience, you could explain each reference as you use it. Personally, I'm greatly in favor of people doing this, because exposure to religions, cultures and traditions other than my own tends to make the world a more interesting place to be.

Finally, remember also that there are traditions within groups also. For example, a programmer using dates within program parameters may reference "date parms" which, to normal people (ie, non-programmer types <grin>) sound just like a tropical tree.
 


Thanks for Reading!
- Vince Barnes

 

Top

Q & A Goodies

Questions are taken from submissions to our Community Mentors. You can ask a Mentor a question by going to http://www.htmlgoodies.com/mentors.



Q. In a web site that I created I made a catalog order form that has a description of an item, a checkbox to select and a textbox for amount to order. The code I have is:
<form name="form1" method="post" action="mailto:Person@person.net?subject=Catalog Order Form1" enctype = "text/plain">
<p>
<input type = "hidden" name = "recipient"
value = Person@person.net />
<input type = "hidden" name = "subject"
value = "Custodial Order Form1" />
</p>
When the submit button is clicked, it goes to the recepient. But the text/plain shows items selected and amount but it also shows amounts not selected i.e.:
ven no:1111, item description
AMOUNT=5
AMOUNT=
AMOUNT=
AMOUNT=
(Etc)
All I want is for the items selected be shown and not all of the AMOUNT= not selected.

A. This is one reason why Server Side languages such as PHP or Perl are used. They allow you to manipulate the form data before it is emailed out. They also work better because some people do not have their email clients set up properly causing the email not to be sent. Having said that though I think your best bet would be to have two forms - one that gathers the information and a second with a hidden element that is actually sent. When they click the submit button the data from the first form is validated, formated and then placed in the hidden form hidden element to be sent. Here is an example of one that I put together for someone else:
<html>
<head>
<title>Order Form</title>
<script language="JavaScript">
function calcamt(num)
{
var qtynum=eval("document.myform.qty"+num+".selectedIndex")
var number=eval("document.myform.szeshp"+num+".selectedIndex")
var sizeshape=eval
("document.myform.szeshp"+num+"[number].value.split(',')")
eval("document.myform.price"+num+".value=sizeshape[1] * qtynum")
var pricenum=parseFloat(eval
("document.myform.price"+num+".value"))
var whole = "" + Math.round(pricenum * Math.pow(10, 2));
var decPoint = whole.length - 2;
if(decPoint != 0)
{
result = whole.substring(0, decPoint);
result += ".";
result += whole.substring(decPoint, whole.length);
}
else
{
result = whole;
}
eval("document.myform.price"+num+".value=result")

totalamt()
}
function qtyreset(numa)
{
if(eval("document.myform.item"+numa+".checked"))
{
}
else
{
alert("You must select the item")
return false
}
eval("document.myform.qty"+numa+".selectedIndex=0")
eval("document.myform.price"+numa+".value='0.00'")
}
function totalamt()
{
var tempamt=0
for(i=0;i<3;i++)
{
var tamt=parseFloat(eval("document.myform.price"+i+".value"))
tempamt=tempamt+tamt

}
var whole = "" + Math.round(tempamt * Math.pow(10, 2));
var decPoint = whole.length - 2;
if(decPoint != 0)
{
result = whole.substring(0, decPoint);
result += ".";
result += whole.substring(decPoint, whole.length);
}
else
{
result = whole;
}
document.myform.totamt.value=result
}
function Formcheck()
{
document.sendit.sdata.value="\r Item
Size Qty Price\r"
for(i=0;i<3;i++)
{
if(eval("document.myform.item"+i+".checked"))
{
var fitem=eval("document.myform.item"+i+".value")
var fnum=eval("document.myform.szeshp"+i+".selectedIndex")
var fsize=eval
("document.myform.szeshp"+i+"[fnum].value.split(',')")
var fqtynum=eval("document.myform.qty"+i+".selectedIndex")
var fqty=eval("document.myform.qty"+i+"[fqtynum].value")
var fprice=eval("document.myform.price"+i+".value")
document.sendit.sdata.value+="\r"+fitem+" "+fsize[0]
+"@ "+fsize[1]+" each "+fqty+" "+fprice+"\r"
}
}
document.sendit.sdata.value+="Total
Amount="+document.myform.totamt.value
}
</script>
</head>
<body bgcolor="lightgreen">
<center>
<br>
<h2>Oder Form</h2>
<br>
ITEM &nbsp &nbsp &nbsp &nbsp SIZE/SHAPE &nbsp &nbsp &nbsp &nbsp &nbsp
&nbsp QTY &nbsp &nbsp PRICE &nbsp &nbsp
<form name="myform">
<input type="radio" name="item0" value="Paper Clips"> Paper Clips
<select name="szeshp0" onchange="qtyreset('0')">
<option value="Small Paper Clips ,2.53" selected>Small Paper
Clips</option>
<option value="Large Paper Clips ,3.45">Large Paper Clips</option>
</select>
<select name="qty0" onchange="calcamt('0')">
<option value="0" selected>0</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
<input type="text" name="price0" value="0.00" size="10" onfocus="this.blur ()">
<br><br>
<input type="radio" name="item1" value="Pencils "> Pencils &nbsp &nbsp
&nbsp
<select name="szeshp1" onchange="qtyreset('1')">
<option value="No2 Pencils ,1.23" selected>No2 Pencils &nbsp
&nbsp &nbsp &nbsp </option>
<option value="No4 Pencils ,1.74">No4 Pencils </option>
</select>
<select name="qty1" onchange="calcamt('1')">
<option value="0" selected>0</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
<input type="text" name="price1" value="0.00" size="10" onfocus="this.blur ()">
<br><br>
<input type="radio" name="item2" value="Staples "> Staples &nbsp &nbsp
&nbsp
<select name="szeshp2" onchange="qtyreset('2')">
<option value="Small Staples ,2.12" selected>Small Staples
</option>
<option value="Large Staples ,2.34">Large Staples &nbsp &nbsp
&nbsp </option>
</select>
<select name="qty2" onchange="calcamt('2')">
<option value="0" selected>0</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
<input type="text" name="price2" value="0.00" size="10" onfocus="this.blur ()">
<br><br>
Total
<input type="text" name="totamt" size="10" onfocus="this.blur()">
</form>
<form name="sendit" method="post" action="mailto:mail@me.com?subject=Order
Form" enctype="text/plain" onsubmit="return Formcheck()">
<input type="hidden" name="sdata">
<input type="submit" value="Send It"> &nbsp <input type="reset"
value="Clear Form" onClick="document.myform.reset()">

</form>
</center>
</body>
</html>


 


Q. I am trying to use code from one of the Javascript Tips (41) to produce a form element that will open a page into a frame. The code works great for one form element. I want to place 2 form elements next to each other, with different choices, but I want them to work the same way by opening a page into a frame. I've tried several configurations but I can't seem to get it to work. If I duplicate the code, but change the form name and select name, only one works. (code sample provided)

A.
I think you will find this example a little more efficient. It uses the onChange event in the select tag to perform the function. At the same time it passes the link in the value tag of the option statement to the function. Just remember to name your dropdowns differently.
<html>
<head>
<title>Drop Down Test</title>
<script language="javascript">
function LinkUp(linkid)
{
if(linkid!="")
{parent.frames[2].location=linkid}
}
</script>
</head>
<body bgcolor="lightgreen">
<form name="DropDown">
<select name="DDlinksa" onchange="LinkUp(this.options [this.selectedIndex].value)">
<option selected value="">Choose a Link
<option value="http://www.htmlgoodies.com"> HTML Goodies</option>
<option value="http://www.wsabstract.com"> Website
Abstraction</option>
<option value="http://www.requestcode.com"> Request Code</option>
</select>
<select name="DDlinksb" onchange="LinkUp(this.options [this.selectedIndex].value)">
<option selected value="">Choose a Link
<option value="http://www.htmlgoodies.com"> HTML Goodies</option>
<option value="http://www.wsabstract.com"> Website
Abstraction</option>
<option value="http://www.requestcode.com"> Request Code</option>
</select>
</form>
</body>
</html>




Q. I uploaded some files via ftp and everything seemed ok, but when i go to look at the site I get the old test pages not the new pages. I have several machines all connecting to the internet via the same adsl router. I have cleared out the browser cache and history on all the machines, rebooted them, connected to the website and I'm still getting the old pages. But, if I use www.anonymizer.com I get the new pages!

A. You mention that you are using an "adsl setup". This has been known to cause caching problems. In the settings for your adsl modem look for the "webproxy" setting. Make sure that there is NOT a check in the box. If there is, "un-check" the box and look at the website again. You may or may not have to re-boot after making this change.


 

 

 

 

Top

News Goodies


Leaders Confront Tech Talent Shortage
[May 27, 2003] Given all the recent layoffs, you'd think the pipeline of engineering talent would be the last thing troubling CEOs. You'd be wrong.

Click here to read the article



 

Linksys has First 11g-to-Ethernet Adapter
[May 27, 2003] The company has announced what it calls the Wireless-G Ethernet Bridge, a unit that will let any thing with an existing Ethernet port get on the wireless network.

Click here to read the article

 



MySQL Takes Database Reins from SAP
[May 27, 2003] MySQL will take over the development of SAP's open-source database, in the hopes of raising its own profile in the market.

Click here to read the article

 

 

 

Congress Splits on Defense IT Spending
[May 27, 2003] House wants $1.7 billion in cuts to force spending below 2003 levels. Senate, Bush push for full funding.

Click here to read the article

 

 


Intel Launches Xeon-focused SMB Program
[May 27, 2003] The No. 1 chipmaker pushes its workhorse server chips with the help of partners and incentives. China, India, Brazil, Mexico and Russia, to get the red-carpet treatment.

Click here to read the article

 


 

Digitally Archiving the Universe
[May 27, 2003] National Center for Supercomputing Applications using Linux clusters to help build Digital Virtual Observatory.

Click here to read the article

 

 

AT&T To Offer Wireless Bundle
[May 27, 2003] With plans to bundle long distance and wireless services on one bill, is it back to the future for the telco?

Click here to read the article

 

 

Is F# a Major or Minor Consideration for Microsoft?
[May 23, 2003] A new programming language from Microsoft for its .NET platform riles up debate among developers and analysts.

Click here to read the article

 

 

House Panel Oks Internet Tax Moratorium
[May 23, 2003] Excluding sales taxes, measure would permanently bar taxes on Internet access.

Click here to read the article

 

 

Gates Sends Letter on Spam to Congress
[May 21, 2003] Microsoft seeks combined legal and technical solution; experts see legislation imminent.

Click here to read the article

 

 

 

 

 


Top

Goodies Peer Reviews


 

Every week a site selected each week for review. Each week, reviews of the previous week's selected site are chosen for publication on the HTML Goodies website.

 

The current week's selected site is published in Goodies To Go and in the Peer Reviews section of the website.  Current contact email addresses for submitting your site and for submitting reviews are published in Goodies To Go.

If you would like to have your site reviewed, sign up for the Goodies To Go newsletter in the Navigation Bar on the left side of this page. 

For full details about this program, see http://www.htmlgoodies.com/peerreviews
 

 

 


Top

Feedback Goodies



Did you ever wish your newsletter was an easy two way communications medium? Ploof! It now is!
If you would like to comment on the newsletter or expand/improve on something you have seen in here, you can now send your input to:

mailto:nlfeedback@htmlgoodies.com


We already receive a lot of email every day. This address will help us sort out those relating specifically to this newsletter from all the rest. When you send email to this address it may wind up being included in this section of the newsletter, to be shared with your fellow readers. Please don't send your questions to this address. They should be sent to our mentors: see http://www.htmlgoodies.com/mentors/

 

Many thanks for your complements about recent newsletters. I enjoy writing them as much as you apparently enjoy reading them!

David Venn-Brown had the following comments about my suggested use of tables for page layouts:

"Although tables perform the function well, they lack the separation of content and presentation that make a site easy to create and maintain. Tables are strictly speaking for tabular data only. They do work, but are not the best way.
CSS and <.div> tags are a far more reasonable option for new websites, although the worth in converting old designs would be limited. With this method, equally stunning, if not more stunning, presentations can be made to the user.
The ability to make the presentation a CSS file allows the site to be easily maintained and altered, while making the HTML less cluttered and easier to work with."

While I don't think I agree with you about the limitations of the use of tables, David, I do agree that CSS has some interesting things to offer for page layouts. It has not been extensively covered in HTML Goodies, however, and is not so widely used as the table mechanism. I might write a piece about it for a future newsletter, however. Many thanks for the suggestion.

 

 

 

Top
And Remember This . . .


On this day in...


We get a bonus day today:
First, May 26 -- the day the newsletter would normally go out:

1981 First Software Patent Granted
After seven years of battle in the courts, computer programmer and patent attorney S. Pal Asija was granted a patent for his software program "SwiftAnswer". Prior to this case, software programs were considered copyrightable writings, as opposed to patentable inventions. This case set the legal precedent for future software patents.

Born today were: in 1886, singer Al Jolson; 1907, actor John Wayne (Marion Morrison); 1908, actor Robert Morley (Adolph Wilton); 1913, actor Peter Cushing; 1948, singer Stevie (Stephanie) Nicks; 1949, singer Hank Williams


And today (your bonus day):

1937 Golden Gate Bridge Opens
having taken five years to build, the 4,200 foot wide Golden Gate Bridge was opened to the public on May 27, 1937. The bridge spans the Golden Gate Strait in the entrance to San Francisco Harbor. Two days later, the bridge was opened to vehicular traffic.

Born today were: in 1794, capitalist Cornelius Vanderbilt; 1837, US Marshall and Forntiersman Wild Bill (James) Hickok; 1907, "Silent Spring" author Rachel Carson; 1911, actor Vincent Price; 1922, actor Christopher Lee; 1923, Henry Kissinger; 1936, actor Lou Gossett; 1943, singer Cilla Black (Priscilla Maria Veronica White);

 

 

 


Thanks for reading Goodies to Go!

 

Archive Home Page.



Make a Comment

Loading Comments...

  • Web Development Newsletter Signup

    Invalid email
    You have successfuly registered to our newsletter.
  •  
  •  
  •  
Thanks for your registration, follow us on our social networks to keep up-to-date