adamwathan / bootforms

Rapid form generation with Bootstrap 3 and Laravel.
MIT License
417 stars 103 forks source link

Feature: setAttributes on Form Element #6

Closed sicsol closed 11 years ago

sicsol commented 11 years ago

Ability to add attributes to a form element

adamwathan commented 11 years ago

Can you explain more clearly what you are looking for? Adding multiple attributes in one call?

sicsol commented 11 years ago

I'd like the ability to add custom attributes like (data, id, onsubmit etc.) to the form element itself

Example

<form action="action" method="post" data-title="title" id="myId" onsubmit="javascript">

adamwathan commented 11 years ago

This should have been possible already, but I found another bug related to the setAttribute method that prevented method chaining, so I updated that anyways.

I've also changed the public API a bit, so now it's attribute($key, $value) and clear($key). Just thought it was a little more concise and less messy when chaining lots of options.