I’ve had a trawl through the API and Documentation and can’t see any way to programatically disable the increment buttons that the CakePHP FormHelper adds to decimal fields.
Does anyone know the proper way to do it in the view, my only other option is to remove them with jQuery, which I can do, but would rather do ‘properly’ if there is a way.
Cheers
My guess is that those increment buttons are not in your HTML, but generated by your browser if you use a ‘number’ input (part of the new HTML 5 input types), e.g. . CakePHP will automatically try to match the right type of input, depending on the fieldtype and name (e.g. ’email’ inputs for email-adresses. You can override this by manually specifying an input type, like this:
This should output a ‘regular’ text-input, which will get no ‘special’ treatment by he browser;
Although, you will also lose the positive sides of these HTML5 inputs, like automatically validating values and disallowing non-numeric characters. There may be options to ‘suppress’ the decoration (step buttons), but this will probably differ for each browser.