Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#229 2020-06-03 06:47:20

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,271
Website GitHub

Re: com_connect - form and contact mailer

Ah, okay, yeah. We can set label instead of content. I was being consistent with how we output it now, and since it validated I didn’t go any further. I’ll look into it. Thanks for the feedback.

I haven’t bundled the plugin as a .txt file yet, colak. I’ll drop you a version via email later since I guess you’re testing this on pre-4.7 which doesn’t support PHP uploads (short of using the plugin cache feature).


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#230 2020-06-03 07:18:54

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,011
Website GitHub Mastodon Twitter

Re: com_connect - form and contact mailer

That did it. Thanks so much Stef and Philippe. The form now validates with some warnings which I will deal with.

The inputmode attribute is not supported in all browsers. Please be sure to test, and consider using a polyfill.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#231 2020-06-03 07:20:22

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,011
Website GitHub Mastodon Twitter

Re: com_connect - form and contact mailer

Bloke wrote #323521:

Ah, okay, yeah. We can set label instead of content. I was being consistent with how we output it now, and since it validated I didn’t go any further. I’ll look into it. Thanks for the feedback.

I haven’t bundled the plugin as a .txt file yet, colak. I’ll drop you a version via email later since I guess you’re testing this on pre-4.7 which doesn’t support PHP uploads (short of using the plugin cache feature).

I’m testing this on the latest txp. No problem, I uploaded the plugin. See my previous post.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#232 2020-06-03 07:55:43

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,079
Website

Re: com_connect - form and contact mailer

The inputmode attribute is mostly a smartphone thingie – it is quite convenient to auto-select an appropriate keyboard that matches the input requirements (numbers / email address…). on your average desktop browser it doesn’t matter all that much.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#233 2020-06-03 08:24:54

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,271
Website GitHub

Re: com_connect - form and contact mailer

I’ve just tweaked the code to add label, as suggested. Still validates. Note the commit message which explains a slight side-effect (duplication of content in the markup). Can we live with it this way? Or should we use the label only for the options="list, of, values" form and no label at all on the <txp:com_connect_option> version (i.e. just use the container)?

It’s non-trivial to make both approaches output the same markup, due to the way the plugin handles attributes.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#234 2020-06-03 08:33:57

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,011
Website GitHub Mastodon Twitter

Re: com_connect - form and contact mailer

Bloke wrote #323527:

I’ve just tweaked the code to add label, as suggested. Still validates. Note the commit message which explains a slight side-effect (duplication of content in the markup). Can we live with it this way? Or should we use the label only for the options="list, of, values" form and no label at all on the <txp:com_connect_option> version (i.e. just use the container)?

It’s non-trivial to make both approaches output the same markup, due to the way the plugin handles attributes.

I cannot see how this would be a problem but Philippe would most probably have a better insight.

phiw13 wrote #323525:

The inputmode attribute is mostly a smartphone thingie – it is quite convenient to auto-select an appropriate keyboard that matches the input requirements (numbers / email address…). on your average desktop browser it doesn’t matter all that much.

That makes sense! I wrapped it in <txp:act_if_mobile> and all works/validates just fine.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#235 2020-06-03 08:51:42

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,079
Website

Re: com_connect - form and contact mailer

Bloke wrote #323527:

I’ve just tweaked the code to add label, as suggested. Still validates. Note the commit message which explains a slight side-effect (duplication of content in the markup). Can we live with it this way? Or should we use the label only for the options="list, of, values" form and no label at all on the <txp:com_connect_option> version (i.e. just use the container)?

Ouch I see… That duplication might be a bit of an issue, accessibility wise. I have to think about it. On the other hand, the code does validate, so there is that.

<option value="Site issue" label="Site issue">Site issue</option>

Hmm, or maybe not. for AT tools and devices, the label will be announced instead of the value so that duplication is not completely there.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#236 2020-06-03 09:03:15

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,271
Website GitHub

Re: com_connect - form and contact mailer

phiw13 wrote #323529:

That duplication might be a bit of an issue, accessibility wise.

Yeah. There is perhaps an avenue I could explore where if the name and label are identical I could just omit the label. That might work. You could reasonably use a different name for the field, but there’s no point repeating it otherwise.

My main concern is that screen readers etc don’t read it twice if there’s a label and container.

Last edited by Bloke (2020-06-03 09:12:23)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#237 2020-06-03 10:07:46

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,079
Website

Re: com_connect - form and contact mailer

The Firefox accessibility inspector sees the label first. So I think this should be fine.

( it also vaguely complains about keyboard access not meeting the requirements, but I think that is just a bogus warning as the widget is fully usable from the keyboard.)


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#238 2020-06-03 14:37:49

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,011
Website GitHub Mastodon Twitter

Re: com_connect - form and contact mailer

There appears to be a problem with the latest changes as there appears that there is no way to have a the valueless option selected when using com_connect_select.

I have tried

<txp:com_connect_select name="txp" label="Is your site powered by txp?" selected="{Select}" options="{Select},Yes,No" class="grid_24" required="1" />

,

<txp:com_connect_select name="txp" label="Is your site powered by txp?" selected="Select" options="{Select},Yes,No" class="grid_24" required="1" />

and

<txp:com_connect_select name="txp" label="Is your site powered by txp?" options="{Select},Yes,No" class="grid_24" required="1" />

which, in the previous version, Select was selected by default.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#239 2020-06-03 14:39:13

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,271
Website GitHub

Re: com_connect - form and contact mailer

Doesn’t selected="" work? (that should be default, btw).


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#240 2020-06-03 14:41:35

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,011
Website GitHub Mastodon Twitter

Re: com_connect - form and contact mailer

Bloke wrote #323536:

Doesn’t selected="" work?

No:(


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

Board footer

Powered by FluxBB