adamwathan / bootforms

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

Add support for input-groups #10

Closed adamwathan closed 8 years ago

adamwathan commented 10 years ago

Continuation of this discussion: https://github.com/adamwathan/bootforms/pull/8#issuecomment-38410525

quocvu commented 10 years ago

There are several types of input-groups. I think we can focus on the more popular ones first.

I would say they are add-ons on the input text. Add-on can be a button, a text (e.g. $), a glyphicon (fontawesome is what I use), an icon (). I think a distant second would be the button dropdown.

Since add-on is only applicable to text, they must be settings of the text widget like BootForm::text()->prependAddOn() or BootForm::text->appendAddOn(). However the text widget is in your Form project which is not bootstrap aware.

The other option would be putting on the FormGroup but it's make less sense since it is only for FormGroup containing a text input.

I am not very fluent on your 2 libs (BootForm & Form) thus I don't know of all the ways to use it.

What do you think?

nCrazed commented 10 years ago

Definitely a desirable feature.

kevindierkx commented 9 years ago

I've noticed that the text and password input 'objects' all get wrapped in a GroupWrapper object. Adding the prepend and append Addon methods to this class would be helpful.

Those methods should only allow certain objects to be provided like a button.

BootForm::text('Username', 'username')
->appendAddon(BootForm::button('button', 'Button'));

I would suggest adding these methods to the wrapper.

zxishere commented 9 years ago

if i need two buttons ,how can i make it?

<div class="col-lg-offset-2 col-lg-10">
<button class="btn btn-default" type="button">button1</button>
<button class="btn btn-default" type="button">button2</button>
</div>
jesseleite commented 9 years ago

Yes please. I like using input-groups for my icons. input-group <3

simplenotezy commented 9 years ago

Would be awesome:

image

ghost commented 8 years ago

Input groups are not supporting buttons yet ?

adamwathan commented 8 years ago

@ricardovigatti I don't think so yet, would happily look at a PR.

adamwathan commented 8 years ago

Basic input groups are supported now, no documentation yet unfortunately but tests here: https://github.com/adamwathan/bootforms/blob/master/tests/BasicFormBuilderTest.php#L545-L628

ghost commented 8 years ago

Nice, i'll try to take an extra time here at my job to check the code and maybe add functions to support those input group with buttons. Ty.

jesseleite commented 8 years ago

Slick :+1:

andresen007 commented 8 years ago

I dont understand, how I make a inputGroup as @JesseLeite is showing, with help from the "tests"-files!

Thanks for the nice job!