Forum Moderators: open

Message Too Old, No Replies

<input> tag syntax

         

KathyJones

2:30 am on Apr 18, 2003 (gmt 0)

10+ Year Member



How do I fix this error?

"end tag for element "INPUT" which is not open (explain...).
Name <input type="text" size="9"></input>"

Following is my code:

<fieldset>
<legend>phone book</legend>
Name <input type="text" size="9"></input>
Number <input type="text" size="9"></input>
</fieldset>

dreaming of nascar

2:32 am on Apr 18, 2003 (gmt 0)

10+ Year Member



<input> tags do not have a closing tag (</input>). Remove these and everything should be fine.

D O N

KathyJones

2:36 am on Apr 18, 2003 (gmt 0)

10+ Year Member



Actually I put that code inside of a table like this: (this is what's outside of that loop, if it helps finding the problem...)

<tr>
<td><center>fieldset</center></td>
<td>draws a box around its containing elements</td>
<td>
<fieldset>
<legend>phone book</legend>
Name <input type="text" size="9"></input>
Number <input type="text" size="9"></input>
</fieldset>
</td>
</tr>

KathyJones

2:38 am on Apr 18, 2003 (gmt 0)

10+ Year Member



Got it, thank you D O N!

Hobgoblin

6:40 am on Apr 18, 2003 (gmt 0)

10+ Year Member



You may also wish to shorten your code by using the align attribute in your <td> tags. You can use "left" and "right" as well. Left is default.

<table>
<tr>
<td align="center">fieldset</td>
<td>draws a box around its containing elements</td>
<td>
<fieldset>
<legend>phone book</legend>
Name <input type="text" size="9"></input>
Number <input type="text" size="9"></input>
</fieldset>
</td>
</tr>
</table>

Birdman

12:33 pm on Apr 18, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



For the record, if you ever decide to switch to XHTML1 [w3.org] , any tags that don't require a closing tag will end with />.

<input type="text" />
<br />
<hr />

And other tags that used to not require closing tags now need them:

<option></option>
<li></li>

Good to know for future reference, anyway.