homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

Help with js form, please!

 3:47 pm on May 3, 2002 (gmt 0)

I'm sure this is an easy one for most of you at WW. I can't get this to work. The errror says object expected line 224. I think that line is the purchase button line. Could someone take a look at this and give a suggestion. Thanks WW!!!!!!!

<script language="JavaScript">
var mat=document.veilopts.illusion.value;
var length=document.veilopts.tier1.value;
var trim=document.veilopts.edge.value;
var motif=document.veilopts.fill.value;
function buildOrder()
var sOrder = "my cart url"+mat+length+trim+motif
var choices = "You picked"+mat+length+trim+motif

Then, in the body:

<form name="veilopts">
<SELECT NAME="illusion" SIZE="1">
<OPTION SELECTED name="White" value="White">White
<OPTION name="Ivory" value="Ivory">Ivory
<OPTION name="diamond" value="diamond">diamond
<OPTION name="sparkle(white)" value="sparkle(white)">sparkle(white)
<OPTION name="sparkle(ivory)" value="sparkle(ivory)">sparkle(ivory)
<input type="button" value="purchase" onClick="buildorder();">



 3:52 pm on May 3, 2002 (gmt 0)

Yep, it was an easy one.

JavaScript is case sensitive.

You are calling the "buildorder()" function in the onClick, which does not exist. That is the object that is expected.

You do have a "buildOrder()" function upstairs which isn't being used.


 4:12 pm on May 3, 2002 (gmt 0)

Man I love this place! Thanks txbakers. :)


 4:21 pm on May 3, 2002 (gmt 0)

One more question: Should and can I place the vars before the function so they can be called on by another function, or do I have to write seperate vars for each function. Thanks agin!


 6:05 pm on May 3, 2002 (gmt 0)

Disregard last question. Figured it out, but now I have another one. How can I turn a variable into a number for math calculations and still be able to use the original output(text) of the variable. For instance, the var mat=the users choice of cloth.I need to use the text choice on the order desc., but I also need to assign that choice a number for pricing. Could someone clue me in. It would be a huge relief to get this page finished.


 7:30 pm on May 3, 2002 (gmt 0)

Anybody out there? Please help!

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved