View Full Version : Newbie...Urgent deadline tomorrow!

04-15-2005, 01:23 PM
I am a javascript newbie! I know nothing about javascript whatsoever. I am having a HUGE problem with a code. I attached the zip file which is the actual grocery list. I also copied and pasted the code in case the zip file does not show up. Any help would be appreciated. Please help I do not know what I am doing =(...

Create a Web page that can be used to write a sorted grocery list. The user will select a category by using radio buttons, then type the name of a grocery item. When the user hits the Add to List button the item is added to the list. Each item should be added in the form “Category > Item”, for example “Produce > Apple”. When the user is finished entering items in any order, she can use the Print Sorted List button to create a sorted list of all of the added groceries. The code containing the form has already been written and can be downloaded (case06–2data.zip). To complete the project you should implement the addItem() and printSortedList() functions.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<title>Grocery List</title>
<script language="JavaScript">
function addItem() {


function printSortedList() {

<form name="groceryList">
Category: <input type="radio" name="category" value="Produce">Produce</input>
<input type="radio" name="category" value="Meat and Cheese">Meat and Cheese</input>
<input type="radio" name="category" value="Grocery">Grocery</input>
<input type="radio" name="category" value="Beverage">Beverage</input>
<br />
Item: <input type="text" length="30" name="item" />
<p />
<input type="button" name="add" value="Add to List" onClick="addItem()"/>
<p />
<select name="list" size="10" style="width:500"></select>
<p />
<input type="button" name="sort" value="Print Sorted List"

04-15-2005, 01:32 PM
I know nothing about javascript whatsoever.

That is too bad. How can we suppose to help you if you are not able to understand what we are talking about?... Anyway, which is in fact your problem?