473,396 Members | 1,693 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

<form> in 4.01 Strict

At <http://snow.prohosting.com/srcopan/src/search.html> I have a simple
form, using the following code provided by my site search provider:

<form method="get" action="http://search.atomz.com/search/">
<input size="20" name="sp-q"><br>
<input type="submit" value="Search">
<input type="hidden" name="sp-a" value="sp06251400">
<input type="hidden" name="sp-p" value="any">
<input type="hidden" name="sp-f" value="ISO-8859-1">
</form>

This code validates as 4.01 Transitional but fails as Strict due to the
use of <input>, <button> being the prefered element in Strict. Fine, but I
can´t for the life of me figure out how to rewrite this code using
<button> instead of <input>, even after studying the examples in the HTML
4.0 Reference and googling. In fact, googling leaves me with the
impression that most folks don´t bother to validate their form
submission code, but my momma didn´t raise me that way.

So, can anyone point me to something that will help me rewrite this code
to validate at 4.01 Strict?

TIA,
--
Warren Post
Santa Rosa de Copán, Honduras
http://srcopan.vze.com/
Aug 1 '05 #1
9 2030
"Warren Post" wrote:
This code validates as 4.01 Transitional but fails as Strict due to the
use of <input>, <button> being the prefered element in Strict.


What gave you that impression? The DTD says a FORM element can contain block
elements and scripts. INPUT isn't a block element. That's why your form
doesn't validate.

Try this:

<form method="get" action="http://search.atomz.com/search/">
<p><input size="20" name="sp-q"><br>
<input type="submit" value="Search">
<input type="hidden" name="sp-a" value="sp06251400">
<input type="hidden" name="sp-p" value="any">
<input type="hidden" name="sp-f" value="ISO-8859-1"></p>
</form>
--
phil [dot] ronan @ virgin [dot] net
http://vzone.virgin.net/phil.ronan/
Aug 1 '05 #2
Warren Post <wp**********@hondutel.hn> wrote:
<form method="get" action="http://search.atomz.com/search/">
<input size="20" name="sp-q"><br>
<input type="submit" value="Search">
<input type="hidden" name="sp-a" value="sp06251400">
<input type="hidden" name="sp-p" value="any">
<input type="hidden" name="sp-f" value="ISO-8859-1">
</form>

This code validates as 4.01 Transitional but fails as Strict due to the
use of <input>, <button> being the prefered element in Strict.


Under strict the form element cannot directly contain inline elements
such as input, nest a block level container in the form element and
it'll validate.

<form method="get" action="http://search.atomz.com/search/">
<p>
<input size="20" name="sp-q"><br>
<input type="submit" value="Search">
<input type="hidden" name="sp-a" value="sp06251400">
<input type="hidden" name="sp-p" value="any">
<input type="hidden" name="sp-f" value="ISO-8859-1">
</p>
</form>

--
Spartanicus
Aug 1 '05 #3
Spartanicus wrote:
<form method="get" action="http://search.atomz.com/search/">
<p>

Erm, why do you both suggest <p>? The form contents look more like
a fieldset than a paragraph to me.

--
Nick Kew
Aug 1 '05 #4
Nick Kew <ni**@asgard.webthing.com> wrote:
Erm, why do you both suggest <p>?
Maybe because people think of <p> as a general block-level element.
The form contents look more like
a fieldset than a paragraph to me.


Well, maybe, but using the <fieldset> element makes a <legend> compulsory
by HTML syntax rules and triggers some browser bugs. Moreover, in a case
like this, <fieldset> has no tangible benefits. Hence I would use <div>,
which is a semantics-free block element and has no default effect upon
rendering.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

Aug 1 '05 #5
Nick Kew <ni**@asgard.webthing.com> wrote:
<form method="get" action="http://search.atomz.com/search/">
<p>

Erm, why do you both suggest <p>? The form contents look more like
a fieldset than a paragraph to me.


Imo fieldset markup is for subdividing a form, the form in question has
only one section/group.

I generally use paragraph markup as a generic block level container
because unlike using a div it can be expected to provide spacing in the
visual domain, and a leading and trailing pause when rendered by a
speech browser. I don't subscribe to the belief that markup should be
strictly semantic. Imo markup should be functional first and foremost.

For example some consider <p><img ...><br>A caption</p> as incorrect
semantic markup since it's clearly not a paragraph. Imo it is
appropriate markup because of the aforementioned functionality it
provides.

That said, in this case the spacing and the leading and trailing pause
can be expected from the form element itself, so on reflection a div
seems the appropriate choice.

--
Spartanicus
Aug 1 '05 #6
On Mon, 1 Aug 2005, Warren Post wrote:
Fine, but I
can´t for the life of me figure out how to rewrite this code using
<button> instead of <input>, even after studying the examples in the HTML
4.0 Reference and googling. In fact, googling leaves me with the
impression that most folks don´t bother to validate their form
submission code, but my momma didn´t raise me that way.


´ is an acute accent.
' is an apostrophe.
Too bad that people with non-English European or American
keyboards all over the world now type accents (´ `) instead of
an apostrophe (').
See http://www.cl.cam.ac.uk/~mgk25/ucs/apostrophe.html .

--
Top-posting.
What's the most irritating thing on Usenet?

Aug 2 '05 #7
Andreas Prilop wrote:
On Mon, 1 Aug 2005, Warren Post wrote:
Fine, but I
can´t for the life of me figure out how to rewrite this code using
<button> instead of <input>, even after studying the examples in
the HTML 4.0 Reference and googling. In fact, googling leaves me
with the impression that most folks don´t bother to validate their
form submission code, but my momma didn´t raise me that way.


´ is an acute accent.
' is an apostrophe.
Too bad that people with non-English European or American
keyboards all over the world now type accents (´ `) instead of
an apostrophe (').
See http://www.cl.cam.ac.uk/~mgk25/ucs/apostrophe.html .


It's even moreso accessible on a Norwegian keyboard layout. This is
from my own laptop keyboard:
http://kimandre.com/img/apostrophe-norway.jpg

One keypress, and that's it!

You can barely see the grave accent and acute accent symbols on one of
the keys above (on the left of the backspace key), accessible by using
the shift key and the AltGr key (in that order). Now, that's two
keypresses (not including the space bar).

Btw, the picture above was taken using my mobile phone camera and
underwent some image post processing on my laptop.

--
Kim André Akerĝ
- ki******@NOSPAMbetadome.com
(remove NOSPAM to contact me directly)
Aug 2 '05 #8
On Tue, 02 Aug 2005 14:55:40 +0200, Andreas Prilop wrote:
Too bad that people with non-English European or American keyboards all
over the world now type accents (´ `) instead of an apostrophe ('). See
http://www.cl.cam.ac.uk/~mgk25/ucs/apostrophe.html .


My case is even worse: I have a U.S. keyboard, configured to
U.S./International. The apostrophe key gives me an acute accent, and the
quotation mark key gives me a ¨. It appeared when I upgraded from
Mandrake Linux 8.2 to 10.0, and I´ve been too lazy to look for a fix.
Thanks for the nudge and the URL.

--
Warren Post
Santa Rosa de Copán, Honduras
http://srcopan.vze.com/
Aug 6 '05 #9
On Mon, 01 Aug 2005 19:22:04 +0100, Philip Ronan wrote:
"Warren Post" wrote:
This code validates as 4.01 Transitional but fails as Strict due to the
use of <input>, <button> being the prefered element in Strict.


What gave you that impression? The DTD says a FORM element can contain
block elements and scripts. INPUT isn't a block element. That's why your
form doesn't validate.


Yes, upon rereading I see you are correct. I read the same thing you
did, but I jumped to an incorrect conclusion. Thanks for the clarification.

Additionally, the solution you and others provided of wrapping <input> in
a block level element works. Many thanks to all.

--
Warren Post
Santa Rosa de Copán, Honduras
http://srcopan.vze.com/
Aug 7 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Michael Hamm | last post by:
Hi, I'm trying to write a <form> whihc will retrieve a Web page on another server. I have (essentially) this: <form action="http://cgi.cs.indiana.edu/~oracle/digest.cgi"> <input...
2
by: Keiron Waites | last post by:
I have the following code: <input type="text" name="search" class="search_top"> <a href="" onclick="window.location='search.inc.php'+document..search. value; return false;"...
3
by: Ben | last post by:
Here's my form: <form name="aForm" method='post'> <input type=file name=file1 onkeypress='KeyPress()'><br> <a id='attachMoreLink' href='javascript:AddFileInput()">Attach More Files </a> <input...
4
by: Howard Jess | last post by:
In Opera 8.01 (Linux; Build 1204) and in Opera 7.54 (Windows XP; Build 3865), my form disappears from the HTML markup (below). To summarize: 1) In a <script> block in the <head> I create a form...
10
by: Phlip | last post by:
HTMListas: (Apologies for I can't Google for this - too many common words.) I have a <form> tag. It thinks I want a <p> break before and after the form. I don't. (My forms are sneaky and...
6
by: snacktime | last post by:
I've searched and searched and have not found a solution to suppress the margin on form or href tags so that there is no space before or after the tag. The only way I have found to do this is to...
4
by: rob c | last post by:
This is a minor thing and only appears in IE (so far), but I'd like to know to correct it (if possible). Whenever I use a form on a webpage, Explorer always leaves a blank line following the...
10
by: neverquit | last post by:
hi , Iam Nagesh,Begineer in using Ajax,well i have been using ajax in application, i have faced a problem while placing the responseTEXT into the <div> tag positioned inside the <form> tag iam...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.