Goodies to Go! Newsletter #317

By Vince Barnes


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


Featured this week:

* Goodies Thoughts - A Year-end Checklist
* Q & A Goodies
* News Goodies
* Feedback Goodies  
* Windows Tech Goodies  
* And Remember This...

 


 

Goodies Announcement

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 - A Year-end Checklist


It seems unbelievable to me - time simply flies by when you're having fun! This year is almost over and it's time to run down the checklist and see how much of the "To Do" list was successfully accomplished. If you're anything like me then your "To Do" list looks fairly much the same right now as it did at the beginning of the year! Time just slips by.

My list has actually grown a little this year - apart from anything else, I have added "Get a new roof" since the three hurricanes we endured here tore the old one to pieces and my house is still covered with a huge blue tarpaulin! Contractors, especially the good ones, are in huge demand in this area so I'll still have to wait a little.

I did verify all my backup procedures this year though, and made several improvements. I've talked about them quite a lot also, and hopefully have inspired you to get yours in order also. In case you missed them, you can check through the newsletter archive (http://www.htmlgoodies.com/letters/index.html) where you'll find some of my discussions.

The last item on my list is probably the most important of all, however. It's short - just two words; simply: Give Thanks.

A couple of years ago I expressed a few thoughts for the end of a year and the holiday season that is celebrated in my corner of the world, and I want to reiterate them this year because they are so applicable in our current times. Christmas has just passed and to all of you who celebrate this holiday, I hope yours was wonderful. These thoughts, however apply to us all:

If my audience was ten thousand strong, and represented a cross section of our global community, only thirty-three hundred of you would be Christian. Twenty-two hundred of you would be Islamic, fifteen hundred would be Hindu, six hundred would be Buddhist and four hundred would be Chinese Traditional. Six hundred more of you would be followers of Sikhism, Juche, Spiritism, Judaism, Baha'i, Jainism, Shinto, Cao Dai, Tenrikyo, Paganism, Unitarianism, Rastafarianism, Scientology, Zoroastrianism or another religion, while the remaining fourteen hundred would either be atheistic or would have no religion at all (atheistic being those that would say there is no supreme being, and the others, secular and agnostic, don't ask the question in the first place and remain neutral, belief-wise.)

Now this little list of interesting facts didn't just pop into my head. I wish my head worked like that! Einstein once said that the greatest knowledge a person can possess is the address of the local library -- he didn't have the internet available, obviously! Doing some research on the Web enabled me to discover these statistics, and a whole lot more about the religions I mentioned - some of which I hadn't even heard of before. In fact, everything worth knowing (and a bunch of facts and information that might not be <grin>) can be found somewhere on the Web. As the Web grows, so does the pool of human knowledge, and vice-versa.

Wars are fought all too frequently in the name of religion. It is my belief that understanding leads to tolerance and peace. Tolerance, by the way, seems to be an important tenet of all these religions. Knowledge leads to understanding, and knowledge can be obtained from the World Wide Web.

The World Wide Web comes from you.

So to all you Web Developers, whatever your religion, background or origin, I wish you wonderful things at this time of the highest holy day of the Christian religion, and thank you for all the work you do to enlighten me via the unprecedented, most magnificent, global communications medium of the World Wide Web. May your creative skills continue to grow, and your knowledge and wisdom continue to flow.
 

 

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 have a Feedback form and have managed to get it to open the e-mail programme in order for the viewer to e-mail their feedback to me, but the problem I am having is to get the SUBJECT line to state "FEEDBACK".

A. If you want the subject line to be filled automatically you need to add "?subject=FEEDBACK" to the MAILTO link like this:
mailto:info@Your_Site.com?subject=FEEDBACK
Change FEEDBACK to anything else if you want something different!





Q. Could you please tell me how to link one page to a specific point on another page? Also, how do I link the top of one page to the bottom of the same page?

A. If you want to link to a spot on a particular page you can use the NAME ANCHOR. For instance if you had a long page and wanted to give the user an easy way to get back to the top after reading the article you would place this in the HTML near the top after the <BODY> tag:
<a name="top">
At the end of the article you would place this code:
<a href="#top">TOP</a>
That creates a link to the top of the page. If you want a link to a certain area on another page it is done in a similar way. On the page you want to link to you place the NAME ANCHOR in the spot on the page you want to jump to:
<a href="jump">Jump Here</a>
On the page you are coming from, the link would look like this:
<a href="#jump">Click here to Jump</a>
Here is the tutorial from the HTMLGoodies site:
http://www.htmlgoodies.com/tutors/pagejump.html

 

 

 

 

 

 

Top

News Goodies


Comair Back in Air After Computer Outage
[December 27, 2004] UPDATED: The airline is back in business after severe snow sidelined planes and caused a Christmas computer outage.

Click here to read the article



 

Gartner to Buy META Group
[December 27, 2004] More consolidation among IT research firms.

Click here to read the article

 

 

 

E-Rate Receives Relief
[December 27, 2004] President Bush signs a bill to free up subsidies for school and library Internet gear.

Click here to read the article

 

 

 

AOL Winning Its Spam Battle?
[December 27, 2004] The ISP said its spam numbers are dropping and staying that course.

Click here to read the article
 

 

 

'OracleSoft,' Blogs and in Between: A Look Back at 2004
[December 24, 2004] As the year ticks down, internetnews.com rounds up the big stories that filled the tech world in 2004.

Click here to read the article

 

 

 

Cyber Criminals Prove Elusive
[December 23, 2004] Law enforcement efforts to snare virus writers are improving, but the most destructive ones have evaded capture.

Click here to read the article

 

 


Countdown to RFID
[December 23, 2004] As the Jan. 1 target to meet retailers' RFID mandates nears, auto-identification in the supply chain remains a work in progress.

Click here to read the article

 

 

 

FCC Gives Nextel More Spectrum Credits
[December 23, 2004] The carrier will receive an additional $452M in credits for airwaves it will exchange with the government.

Click here to read the article


 

 

Red Hat Plays Scrooge
[December 23, 2004] Red Hat had nothing but coal for investors on Thursday.

Click here to read the article

 

 

 

Opera Launches New Rendition
[December 23, 2004] The browser's latest release surpasses expectations in full-scale launch.

Click here to read the article

 

 

 

 

 

 


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/




Thanks again for all your feedback!
 

 

Top


 


Windows Tech Goodie of the Week:
 



A Look at WebCharts, a Free .NET Charting Control

Recently I discovered a free .NET charting tool from Microsoft employee Carlos Aguilar Mares called WebChart. This article provides a quick overview of WebChart, demonstrating how to use it in an ASP.NET Web application.

http://aspnet.4guysfromrolla.com/articles/120804-1.aspx


*** AND ***


Server-Side Printing to a Networked Printer from ASP


A while back I wrote "Server-Side Printing from ASP" which explained how to print plain text to a printer directly connected to your web server. Since then, I've received quite a few email from people looking to accomplish the same task on a networked printer.

http://www.asp101.com/articles/john/serversideprint/network.asp


*** AND ***


Designing Role-Based Security Models for .NET


In this article, Michele Leroux Bustamante discusses authentication, authorization and role-based security in .NET. Along the way, he provides some best practices for implementing role-based security in some typical .NET application scenarios including rich clients, Web applications, and Web services.

http://www.15seconds.com/issue/041208.htm


 

 


 

Top


 

 

 

 
And Remember This . . .


On this day in...
 

1932 Radio City Music Hall Opened

A creation of billionaire John D. Rockefeller, the Radio City Music Hall was opened on this day in 1932. Since that day, more than 300 million people (including yours truly) have been there to enjoy shows, concerts, movies and special events. Despite being in the middle of the Great Depression, thousands of people came to the opening event. The hall is a magnificent Art Deco theater, a "palace for the people", designed by Donald Deskey, and built by Rockefeller in partnership with the Radio Corporation of America (RCA). At its heart is the Great Stage, which is 60 feet by 100 feet and incorporated sophisticated hydraulic elevators for dramatic staging effects. Many of the original hydraulics are still in use today. More than 700 films have premiered at Radio City Music Hall. Its "Christmas Spectacular", which debuted in 1933, entertains more than a million people each year, and includes the famous high-kicking precision dance troupe, the Rockettes. It is still the largest theater in the world.


Today was also the day that in: 1825 the first public railroad, using a steam locomotive, opened in England; 1831 Darwin began his voyage to South America aboard HMS Beagle; 1836 15 people were buried, 8 of whom perished; by the worst avalanche in England's history, at Lewes, Sussex; 1871 the world's first cat show opened at Crystal Palace in London, England; 1934 the first Youth Hostel in the US opened in Northfield, Massachusetts; 1934 the Shah of Persia declared that Persia was now to be called Iran; 1937 Mae West performed the Adam & Eve skit on the Charlie McCarthy show that got her banned from NBC radio; 1945 the International Monetary Fund and the World Bank were founded; 1947 the first "Howdy Doody Show" aired on NBC TV; 1949 Queen Julianna of Holland granted sovereignty to Indonesia; 1978 King Juan Carlos ratified Spain's first democratic constitution; 1979 Soviet troops invaded Afghanistan, President Hafizullah Amin was overthrown; 1983 a propane gas fire burned 16 blocks on Buffalo, New York; 1985 Terrorists killed 20 & wounded 110 attacking El Al at Rome & Vienna airports - President Reagan blamed Libyan leader Colonel Muammar Qaddafi; 1988 Bulgaria stopped jamming Radio Free Europe after more than 3 decades; 1992 Harry Connick Jr was caught with 9mm gun in New York's JFK airport;


Born today were: in 1654 Swiss mathematician Jean/Jacobus Bernoulli; 1822 French bacteriologist Louis Pasteur; 1879 English actor Sydney Greenstreet; 1879 Australian actor Robert Grieg; 1901 German singer/actress Marlene Dietrich; 1906 actor Oscar Levant; 1939 ACTOR jOHN aMOS; 1941 English musician Leslie Maguire (Gerry & the Pacemekers); 1941 English musician Michael Pinder (the Moody Blues); 1943 newscater Cokie Roberts; 1943 English musician Dave Rowberry (the Animals); 1944 musician Mick Jones (Foreigner); 1948 musician Larry Byrom (Steppenwolf); 1948 French actor Girard Depardieu; 1952 actress Tovah Feldshuh;1960 English actress Maryam D'Abo; 1973 actor Wilson Cruz;

 


Thanks for reading Goodies to Go!



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