The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Help need validating HTML 4.0 contact form (code included)
leet8845
post Sep 21 2007, 08:41 AM
Post #1





Group: Members
Posts: 9
Joined: 28-February 07
Member No.: 2,053



Hi all,

I have built a web site in dreamweaver, and i have been validating my pages as I go along.

Everthing has been fine so far however, I get a error for every text field on my contact form;

'the tag: "input" has an XML style closing syntax for an empty element even though version: "HTML4" is not an XML tag language.[HTML 4.0]'

I'm not sure what the proper way for inserting a input tag is, so it validates.

Any help appreicated

Thanks for looking

Here is my form;

CODE
<form id="form1" name="form1" method="post" action="">
      <table width="100%" cellpadding="3">
        <tr>
          <td width="23%" class="style1">Name: </td>
          <td width="54%"><input type="text" name="textfield" /></td>
          <td width="23%"> </td>
        </tr>
        <tr>
          <td class="style1">Company Name: </td>
          <td><input type="text" name="textfield2" /></td>
          <td> </td>
        </tr>
        <tr>
          <td class="style1">Message:</td>
          <td><textarea name="textarea" rows="3" cols="21"></textarea></td>
          <td> </td>
        </tr>
        <tr>
          <td class="style1">Address Line 1: </td>
          <td><input type="text" name="textfield4" /></td>
          <td> </td>
        </tr>
        <tr>
          <td class="style1">Address Line 2 </td>
          <td><input type="text" name="textfield5" /></td>
          <td> </td>
        </tr>
        <tr>
          <td class="style1">Postcode:</td>
          <td><input type="text" name="textfield6" /></td>
          <td> </td>
        </tr>
        <tr>
          <td> </td>
          <td><input type="submit" name="Submit" value="Submit"></td>
          <td> </td>
        </tr>
      </table>
        </form>

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Sep 21 2007, 10:40 AM
Post #2


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



QUOTE
'the tag: "input" has an XML style closing syntax for an empty element even though version: "HTML4" is not an XML tag language.[HTML 4.0]'

I don't know what tool said that, but it seems to say that you use XHTML syntax in a HTML document. That's a no-no. smile.gif

Also, if you really use a HTML 4.0 doctype I strongly encourage you to change that to HTML 4.01.
http://htmlhelp.com/tools/validator/doctype.html

QUOTE
I'm not sure what the proper way for inserting a input tag is, so it validates.


Just ditch the XHTML slash at the end of the tag.
http://htmlhelp.com/reference/html40/forms/input.html

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
leet8845
post Sep 21 2007, 10:54 AM
Post #3





Group: Members
Posts: 9
Joined: 28-February 07
Member No.: 2,053



QUOTE(pandy @ Sep 21 2007, 10:40 AM) *

QUOTE
'the tag: "input" has an XML style closing syntax for an empty element even though version: "HTML4" is not an XML tag language.[HTML 4.0]'

I don't know what tool said that, but it seems to say that you use XHTML syntax in a HTML document. That's a no-no. smile.gif

Also, if you really use a HTML 4.0 doctype I strongly encourage you to change that to HTML 4.01.
http://htmlhelp.com/tools/validator/doctype.html

QUOTE
I'm not sure what the proper way for inserting a input tag is, so it validates.


Just ditch the XHTML slash at the end of the tag.
http://htmlhelp.com/reference/html40/forms/input.html


Many thanks for helping!

My document is 4.01 i think

CODE
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">


How do I ditch the xhtml slash at the end of the tag? sorry im a noob, can you give me a example of what you mean by this?

Lee

This post has been edited by leet8845: Sep 21 2007, 10:55 AM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Darin McGrew
post Sep 21 2007, 11:01 AM
Post #4


WDG Member
********

Group: Root Admin
Posts: 8,365
Joined: 4-August 06
From: Mountain View, CA
Member No.: 3



The word "ditch" is slang for "get rid of".

Just change <input ... /> to <input ...> and so on.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
leet8845
post Sep 21 2007, 11:09 AM
Post #5





Group: Members
Posts: 9
Joined: 28-February 07
Member No.: 2,053



QUOTE(Darin McGrew @ Sep 21 2007, 11:01 AM) *

The word "ditch" is slang for "get rid of".

Just change <input ... /> to <input ...> and so on.


Thanks for your help!!!

Kindest Regards

Lee
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Sep 21 2007, 11:13 AM
Post #6


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



Sorry. I'll try to watch my language. Not easy for us ESLers. tongue.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
leet8845
post Sep 21 2007, 11:39 AM
Post #7





Group: Members
Posts: 9
Joined: 28-February 07
Member No.: 2,053



I knew what you meant by the term 'ditch', i'm from the uk but know alot US slang from TV and online gaming smile.gif

My problem was, I didn't what I had to ditch!

This is solved now thanks to you 2, do I need to mark the post solved or anything?

Many thanks

Lee
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Darin McGrew
post Sep 21 2007, 01:31 PM
Post #8


WDG Member
********

Group: Root Admin
Posts: 8,365
Joined: 4-August 06
From: Mountain View, CA
Member No.: 3



There's no need to mark the thread. You're welcome!
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Chris_E
post Sep 27 2007, 09:36 AM
Post #9





Group: Members
Posts: 1
Joined: 27-September 07
Member No.: 3,916



Hi All

The concern I have about this - I have te same problem, is why is Dreamweaver adding these XML tag endings? Is there a settting in DW that makes it happen?

Any ideas?

This post has been edited by Chris_E: Sep 27 2007, 09:37 AM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Frederiek
post Sep 28 2007, 02:29 AM
Post #10


Programming Fanatic
********

Group: Members
Posts: 5,146
Joined: 23-August 06
From: Europe
Member No.: 9



I don't use DW, but DW probably does that when you use a XHTML doctype setting for your document. Surely you should be able to set which doctype DW should use by default. Somewhere in the preferences? Or search the manual or for help at adobe.com.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 19th April 2024 - 02:56 PM