Re: "Forms" HELL!!!

by "Donna M Smillie" <dms(at)zetnet.co.uk>

 Date:  Sun, 23 Jan 2000 11:06:26 -0000
 To:  <WSherratt(at)aol.com>,
<hwg-techniques(at)mail.hwg.org>
 References:  aol
  todo: View Thread, Original
----- Original Message -----
From: <WSherratt(at)aol.com>

> Heya gang,

Hi Will :-)

> Man, I was trying to put up a form for a greeting card designer
> http://www.spi-web.co.uk/pipsqueek/order.htm
> for some reason, the form doesn't email to the recipient!!
>
> I then tried to mess about with the form so that javascripts could do
> addition simply
> http://www.spi-web.co.uk/order-main.htm
> but not only will that not post to anyone, it seems to add stuff up
wrongly.

Couldn't see any Javascript on that page - did you put the trial javascript
version somewhere else?

Anyway, to get a form to send data, you have to give each form element a
name.  Otherwise, the form can't send any data entered in that element.  In
the terms of the HTML 4 spec for forms it isn't regarded as a "successful"
control (ie something that will get sent when the form is submitted) - see
http://www.w3.org/TR/html4/interact/forms.html for a wealth of info on
forms.  In particular, section 17.13.2 in the spec defines a "successful
control" :

"A successful control is "valid" for submission. Every successful control
has its control name paired with its current value as part of the submitted
form data set. A successful control must be defined within a FORM element
and ***must have a control name***." (my emphasis)

So, instead of just:

<input size=5>

- you need to have something like:

<input type="text" size="5" name="ordernumber1">

The TYPE="text" isn't absolutely necessary, since that is the default for
the INPUT element, but I find it helps to keep me straight on what I'm
doing if I put the TYPE in for all INPUT elements.  What IS necessary is
the name.  I made a copy of your form, added names to the first few form
elements, then tried filling them in and submitting the form - it worked
OK.  (Note you've got a typo - <input size=20</br> - which has been copied
on each line of the form and which will need to be tidied up too before
those input elements will work correctly I suspect).

HTH!

Regards,
Donna
--
dms(at)zetnet.co.uk
Different Worlds:  http://www.users.zetnet.co.uk/dms/
Pictures of the Past, The Leslie Smith Family,
An Introduction to HTML, Copyright Considerations
Online Bookshop

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA