I have been trying to use <button> instead of <input> tags for form submissions, but also wanted to be able to add a <span> tag within the <button> tag to have more options with CSS styling
After searching through code in the Sapphire framework I found that the tags are build in FormField.php starting on line 495. I changed the code on line 502 to look as follows
So everything seemed to work just right, until I logged into the CMS and discovered that now the buttons for "unpublish", "save". "save and publish", etc. are no longer working.
I would advise against modifying Sapphire or CMS for the intention of styling buttons. It's bound to break the cms.
styling the buttons without the span
building the forms yourself in the template, then you can have what ever crazy tags you want
using jquery to add the spans to the button tags on document load
I don't like changing anything in Sapphire, and changed everything back to the way it was. Using the <input> submit works well, just limits the way I would have liked to style the buttons. I'm using the userforms modul, which adds an other layer of code that I really rather not deal with. I had hoped for a quick and simple solution, but can deal with what I got.
Just FYI: it was not the <span> tag that caused the problem in the backend, but the <button> tag itself. I tried without the <span> tag and saving still didn't work, until going back to <input>