Textpattern Forum

You are not logged in. Register | Login | Help

#1 2012-06-21 14:04:12

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 598
Website

r3819 forms nested in fieldset

The reshuffle in r3819 introduced a weirdo bug: on the image edit pane and the file edit pane forms are nested inside fieldset. That is invalid html. It should be the other way around !

Example (seen on the edit file pane):

<fieldset class="replace-file">
<legend>
Replace file&nbsp;<a rel="help" ….</legend>
<form class="upload-form" method="post" enctype="multipart/form-data" action="index.php">...
<p class="edit-file-replace">&nbsp;<input type="file" value="" name="thefile" id="file_replace">&nbsp;<input type="submit" value="Upload"></p>
<input type="hidden" value="48304ed1c15b6e5d13a61157c18de8ee" name="_txp_token">
</form>
</fieldset>

(some code snipped for brevity)

Expected:

<form>
<fieldset><legend>
<input type=hidden ......>
etc

Offline

#2 2012-06-21 14:47:40

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 5,711
Website

Re: r3819 forms nested in fieldset

phiw13 wrote:

forms are nested inside fieldset. That is invalid html. It should be the other way around !

I’m sure you’re right, but it beats me why the validator never complained when I ran it through each page. Weird.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern.

Txp Builders – finely-crafted code, design and Txp

Offline

#3 2012-06-21 15:04:03

maniqui
Moderator
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 2,967
Website

Re: r3819 forms nested in fieldset

Beside validating (or not), it’s definitely an anti-pattern, imo.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#4 2012-06-21 15:04:44

philwareham
Core designer
From: Farnham, Surrey, UK
Registered: 2009-06-11
Posts: 1,520
Website

Re: r3819 forms nested in fieldset

Philippe is correct, fieldset tag needs to go inside form tag in 4 instances (1 instance on file edit page, and 3 instances on image edit page).

Offline

#5 2012-06-21 15:08:27

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 5,711
Website

Re: r3819 forms nested in fieldset

Rats. The <form> tags are generated by a function, and sometimes the forms do need fieldsets, and other times they don’t.

That’s gonna make for some ugly code, or a new wrapper function. The latter is the lesser of two weevils I guess.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern.

Txp Builders – finely-crafted code, design and Txp

Offline

#6 2012-06-21 15:09:16

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 598
Website

Re: r3819 forms nested in fieldset

Bloke wrote:

I’m sure you’re right, but it beats me why the validator never complained when I ran it through each page. Weird.

Weird indeed. But it doesn’t make sense. fieldset is a form control. But given the weasel wording that the htmls 5 spec is becoming, maybe the validator is correct.

http://dev.w3.org/html5/spec/single-page.html#forms

Offline

#7 2012-06-21 16:50:48

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 5,711
Website

Re: r3819 forms nested in fieldset

Considering dropping the fieldsets in favour of div / levers as used everywhere else in the core. Advantage: feels better.
Possible disadvantage: the widgets become collapsible, subject to me putting in a smidgeon of code to retain the settings.

While it’s not a disadvantage per se, having a collapsible control around a single UI element seems a bit of a waste of effort, even if it is consistent with the other panels. But in this case it’s probably better than fugly code hacks or bad validation. Any objections?


The smd plugin menagerie — for when you need one more gribble of power from Textpattern.

Txp Builders – finely-crafted code, design and Txp

Offline

#8 2012-06-21 23:59:44

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 5,711
Website

Re: r3819 forms nested in fieldset

Phil’s pointed me in a better direction than the fieldsets: non-lever <div>s. He’s sending me a new CSS file in the morning so I’ll commit this latest patch tomorrow:

  • Fixes fieldset validation in Images/Files panels.
  • Fixes a handful of stupid label ID/input control mismatches on the Edit Comment panel (I must have been falling asleep at the keyboard)
  • Fixes a couple of label-to-non-input validation warnings on the Edit Author panel.
  • Brings the Admin->Import panel to the ‘no tables’ party (at least, on the setup side; the results page is still a list of feedback junk, so the table remains there for the time being). Can anyone test this panel still behaves as it should and report back please?

After that I have some subtle changes to the multi-edit tool in the next couple of days, the new Sections panel is 99.4% done, and I have Gocom’s spiffing shorter, speedier, more cross-browser textpattern.js to roll in. Should have it all finished by the end of the weekend, with luck, then it’s over to everyone else to make sure nothing’s been missed.

Can I just take the opportunity to thank everyone for bearing with us while the cement sets in this wall of changes, and for all the feedback that has helped shape it to date. And a special mention to Phil Wareham who has worked tirelessly auditing the HTML/CSS, mocking up things, and patiently coping with an almost daily barrage of half-arsed patches from me over the past couple of months as we take steps in the general direction of his admin-side utopia. Beer’s on me next time.

Last edited by Bloke (2012-06-22 01:04:00)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern.

Txp Builders – finely-crafted code, design and Txp

Offline

#9 2012-06-22 00:13:39

maruchan
Member
From: Ukiah, California
Registered: 2010-06-12
Posts: 547
Website

Re: r3819 forms nested in fieldset

It’s been pretty amazing to watch this unfold. Thanks for your work!

Offline

#10 2012-06-22 07:44:55

Algaris
Member
From: England
Registered: 2006-01-27
Posts: 392

Re: r3819 forms nested in fieldset

I completely agree with Marc. I love the open development style that the Textpattern Dev’s and Phil et al. have adopted. Thank you so much for all your hard work.

Offline

Board footer

Powered by FluxBB