HTML5 <button> and PHP

Is it possible that a PHP form processor can only function when the ‘value’ attribute is present?

For example, I’ve used this with other processors and it always works,

<button name="contactSubmit">Submit</button>

But with a specific CMS plugin (processor) it doesn’t.

However, it does work with the ‘value’ attribute,

<button name="contactSubmit" value="Submit">Submit</button>

As far as I know the ‘value’ attribute is not required with (is it even valid?) which makes me think it’s a processor issue.

Todd
http://xiiro.com


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Point your form at the Reflector: Reflector That will tell you the raw form data that are being sent. If you don’t see your button name in any of the arrays, then it’s not being sent by the browser. Any form processor can extract anything sent in the post, get, session, or cookie variables. But if the browser doesn’t send it in one of those, then you don’t get to do anything with it.

Walter

On Jun 28, 2014, at 2:27 PM, Todd wrote:

Is it possible that a PHP form processor can only function when the ‘value’ attribute is present?

For example, I’ve used this with other processors and it always works,

<button name="contactSubmit">Submit</button>

But with a specific CMS plugin (processor) it doesn’t.

However, it does work with the ‘value’ attribute,

<button name="contactSubmit" value="Submit">Submit</button>

As far as I know the ‘value’ attribute is not required with (is it even valid?) which makes me think it’s a processor issue.

Todd
http://xiiro.com


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

With and without the ‘value’ attribute I see the button name in the array,

[contactSubmit] =>

The difference being that when value=“Submit” is present it looks like this,

[contactSubmit] => Submit

Does this mean the form is indeed working even without the ‘value’ attribute? If so, then I don’t understand why the submission isn’t making the trip.

T.

If you don’t see your button name in any of the arrays, then it’s not being sent by the browser.


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Your form handler may be testing for a value on the button, not just its presence in the array. Try making another input named contactSubmit, only this time make it a hidden field. Give it some value – any value – and name your submit button something else. That should get your form to be handled.

Walter

On Jun 28, 2014, at 3:42 PM, Todd wrote:

With and without the ‘value’ attribute I see the button name in the array,

[contactSubmit] =>

The difference being that when value=“Submit” is present it looks like this,

[contactSubmit] => Submit

Does this mean the form is indeed working even without the ‘value’ attribute? If so, then I don’t understand why the submission isn’t making the trip.

T.

If you don’t see your button name in any of the arrays, then it’s not being sent by the browser.


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

That’s what I was thinking and why I posted the question. I’m not going to start poking around with the handler, though.

I don’t know if using the ‘value’ attribute with is valid markup (I’m going to check it) but maybe I should just go back to using the old instead of .

Todd

Your form handler may be testing for a value on the button, not just its presence in the array.


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Yeah, I don’t know of too many valid use-cases for the button tag, except maybe if you are building a JavaScript one-page app or something, and handling its event with a client-side script.

Walter

On Jun 28, 2014, at 4:40 PM, Todd wrote:

That’s what I was thinking and why I posted the question. I’m not going to start poking around with the handler, though.

I don’t know if using the ‘value’ attribute with is valid markup (I’m going to check it) but maybe I should just go back to using the old instead of .

Todd
http://xiiro.com

Your form handler may be testing for a value on the button, not just its presence in the array.


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options