Javascript Order form help

  • (2 Pages)
  • +
  • 1
  • 2

24 Replies - 3355 Views - Last Post: 13 July 2010 - 01:16 PM

#16 sajohnson05  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 97
  • Joined: 09-September 09

Re: Javascript Order form help

Posted 13 July 2010 - 06:17 AM

What do you mean a live page?
Was This Post Helpful? 0
  • +
  • -

#17 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3392
  • View blog
  • Posts: 9,586
  • Joined: 08-June 10

Re: Javascript Order form help

Posted 13 July 2010 - 06:19 AM

put the page on a webserver and post the link to that page here.
Was This Post Helpful? 0
  • +
  • -

#18 sajohnson05  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 97
  • Joined: 09-September 09

Re: Javascript Order form help

Posted 13 July 2010 - 06:23 AM

http://www.radford.e...nson/hw_4.html. There you go.
Was This Post Helpful? 0
  • +
  • -

#19 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3392
  • View blog
  • Posts: 9,586
  • Joined: 08-June 10

Re: Javascript Order form help

Posted 13 July 2010 - 06:40 AM

problem:
var dom = document.getElementById("myForm");
for (var i=0; i<dom.myCheckBox.length; i++)


the variable dom is a HTMLElement. by calling dom.myCheckBox you request the myCheckBox property, which of course doesn’t exist as myCheckBox is the ID of a nested form element, which doesn’t exist due to HTML restrictions (forms must not be nested).

This post has been edited by Dormilich: 13 July 2010 - 06:41 AM

Was This Post Helpful? 0
  • +
  • -

#20 sajohnson05  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 97
  • Joined: 09-September 09

Re: Javascript Order form help

Posted 13 July 2010 - 06:55 AM

How would i go about fixing this?
Was This Post Helpful? 0
  • +
  • -

#21 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3392
  • View blog
  • Posts: 9,586
  • Joined: 08-June 10

Re: Javascript Order form help

Posted 13 July 2010 - 07:12 AM

correct the HTML errors first. use the W3C validator, until no more errors are shown. (main thing to do: fix the form)
Was This Post Helpful? 0
  • +
  • -

#22 sajohnson05  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 97
  • Joined: 09-September 09

Re: Javascript Order form help

Posted 13 July 2010 - 08:16 AM

updated file with correcting errors. Can you take a look at it again and see if you can help me with the myCheckBox issue.
Was This Post Helpful? 0
  • +
  • -

#23 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3392
  • View blog
  • Posts: 9,586
  • Joined: 08-June 10

Re: Javascript Order form help

Posted 13 July 2010 - 12:08 PM

your forms are still a mess.

what you need to consider:
  • forms must always be closed
  • forms must not be nested
  • forms need an action attribute

Was This Post Helpful? 0
  • +
  • -

#24 sajohnson05  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 97
  • Joined: 09-September 09

Re: Javascript Order form help

Posted 13 July 2010 - 01:04 PM

Ok all forms now closed, no nested form, and all forms have action attribute. Question, if i can not have nested forms how then can i get my textarea in my black box?
Was This Post Helpful? 0
  • +
  • -

#25 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3392
  • View blog
  • Posts: 9,586
  • Joined: 08-June 10

Re: Javascript Order form help

Posted 13 July 2010 - 01:16 PM

make the black box a <div> (or even better, a <fieldset>) and put the textarea in.

you can also use the <fieldset> elements to set a border around certain input elements (which would make way more sense than using several form elements).

additional tip: use <label>s to label your elements. modern browsers jump to the according <input> when you click on its label.

This post has been edited by Dormilich: 13 July 2010 - 01:22 PM

Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2