Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

warning <input> element not empty or not closed 1

Status
Not open for further replies.

richey1

Technical User
Oct 5, 2004
184
GB
I've got a web page, which I've put through firefox and its giving me a warning as the subject above.
this is my html below - i can't see the problem

strComplaints = strComplaints & "<tr><td width=""50%""><label for=""title"">Title (Mr, Mrs, Miss, Ms)</label></td><td width=""50%""><input type=""text"" name=""title"" id=""title"" title=""Title"" size=""20"" value=""" & title & """>*</input></td></tr>"

it is highlighting the input for
<input type=""text""

and the help tells me (but i have closed the input tag !)

... element not empty or not closed
Cause:

XHTML error. A tag has been opened and not closed.
Solution:

Close the tag
Sample:

<input> element not empty or not closed


regards
kim
 
thanks

yeah i have to use double quotes because I am using a 3rd party software package and you have to build it up as a string, I've got thousands of other pages that are ok - i just can't see what is wrong with that, assuming the double quotes are ok !
 
I think it's the * between <input> and </input>. I'd try:
Code:
strComplaints = strComplaints & "<tr><td width=""50%""><label for=""title"">Title (Mr, Mrs, Miss, Ms)</label></td><td width=""50%""><input type=""text"" name=""title"" id=""title"" title=""Title"" size=""20"" value=""" & title & """ /></td></tr>"

-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd
 
yeah thats it - thanks
it was there for a reason - * marks a mandatory field but I'll have to do something else with it !?!

thanks again
 
yes thanks that has worked nicely - I am now using the label tag instead, as you better accessibility

thanks
 
Input is an empty element and cannot have any content. This
Code:
<input type="text"></input>
is XHTML valid and
Code:
<input type="text" />
is also valid, but as soon as you put some content within the opening and closing tag, it is invalid.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top