473,549 Members | 2,751 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

<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.co m/search/">
<input size="20" name="sp-q"><br>
<input type="submit" value="Search">
<input type="hidden" name="sp-a" value="sp062514 00">
<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 2045
"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.co m/search/">
<p><input size="20" name="sp-q"><br>
<input type="submit" value="Search">
<input type="hidden" name="sp-a" value="sp062514 00">
<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**********@h ondutel.hn> wrote:
<form method="get" action="http://search.atomz.co m/search/">
<input size="20" name="sp-q"><br>
<input type="submit" value="Search">
<input type="hidden" name="sp-a" value="sp062514 00">
<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.co m/search/">
<p>
<input size="20" name="sp-q"><br>
<input type="submit" value="Search">
<input type="hidden" name="sp-a" value="sp062514 00">
<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.co m/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.we bthing.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.we bthing.com> wrote:
<form method="get" action="http://search.atomz.co m/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******@NOSPAM betadome.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
6172
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 type="submit"><select name="N"> <option value="1234#1234-01">foo <option value="1010#1010-02">bar <option value="1001#1001-03">baz
2
2592
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;" class="search_top">go</a> What do I put within to access the value of the input field search so I can access it's value? Thanks,
3
12907
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 type=submit value='Done'> </form>
4
2516
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 element (part of object/feature/bug detection). 2) There's a <form> element defined in the <body>, with the id 'theForm'. 3) The onload function...
10
8927
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 inline.) How do I avoid paragraph breaks around a <form> tag?
6
3865
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 place the tags one after another without any spaces between them. For example, a space gets rendered between these two href's when displayed in...
4
3707
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 </form> tag but Mozilla doesn't. Is there a way to supress the blank line? Thanks Rob www.rcp.ca
10
14138
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 able to get the response in the <div> tag in mozilla (im takingthe HTML response), <script> function confirm() { xmlHttp=GetXmlHttpObject();...
0
7477
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7991
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7838
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6084
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5118
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3503
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1971
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1084
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
790
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.