Welcome to WebmasterWorld Guest from 54.196.232.162

Forum Moderators: open

Message Too Old, No Replies

Help with js form, please!

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

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Apr 22, 2002
posts:2546
votes: 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
alert(choices);
window.open(sOrder,'cartwin','width=600,height=400,scrollbars,location,resizable,status');
}
</script>

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)
</SELECT>
<input type="button" value="purchase" onClick="buildorder();">
</form>

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

Senior Member

WebmasterWorld Senior Member txbakers is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Sept 1, 2001
posts:4392
votes: 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)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Apr 22, 2002
posts:2546
votes: 0


Man I love this place! Thanks txbakers. :)
4:21 pm on May 3, 2002 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Apr 22, 2002
posts:2546
votes: 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)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Apr 22, 2002
posts:2546
votes: 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)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Apr 22, 2002
posts:2546
votes: 0


Anybody out there? Please help!