Comments (6)
Well that's actually more of a Bootstrap problem than a Former one : Former automatically creates the correct Bootstrap syntax to have fields all in the right places but in Javascript I don't really know how you could make them render properly without using all the control group syntax : http://twitter.github.com/bootstrap/base-css.html#forms
from former.
I see, but what happens is that without creating the Former::open() the group syntax is not created for the field. The output for the following code is:
{{Former::mini_text('visa_value[]','visa_value')->prepend('$')->required()->class('span9')->value($visa_option->value)}}
<label for="visa_value[]">Valor<sup>*</sup></label>
<input class="span9" required="true" type="text" name="visa_value[]" id="visa_value[]">
when was supposed to be:
<div class="control-group required">
<label for="visa_value[]" class="control-label">Valor<sup>*</sup></label>
<div class="controls">
<div class="input-prepend">
<span class="add-on">$</span>
<input class="span9" required="true" type="text" name="visa_value[]" id="visa_value[]">
</div>
</div>
</div>
That's why I thought could be a Former issue for not generating the control group syntax.
from former.
Now that's normal, by default fields outside of a form are considered inline because most of the time when you put fields outside of forms it's in random places, tables and stuff. This is kind of one of the tricky parts of Former.
I don't think there's a way to add the control group for a specific field outside of a form. You can do the opposite (remove the group with ->raw
) but there's nothing yet to add a group where there isn't supposed to be one. Maybe if you have a suggestion of way to handle that I could implement it ?
from former.
That's right, make sense.
I can try to think in a best way, but the way that just poped in my mind,
could be something the same way that you define the size of the field, for
example
Former::mini_text(...);
You can set also if you want in a group control, something like:
Former::grouped_mini_text(...);
Former::group_mini_text(...);
Or any other word that make more sense.
from former.
Hm this is not bad, I'll think about it see what I come up with.
from former.
OK, thanks
from former.
Related Issues (20)
- Add method to create new field from string HOT 7
- Allow field->required() to receive a boolean HOT 1
- Allow field->inline() to receive a boolean HOT 2
- Add a Choice field type HOT 4
- Laravel 5.7 support HOT 1
- Support Bootstrap4 HOT 1
- Former Twitter Bootstrap 4 Not working HOT 2
- Custom Rule classes not working HOT 1
- Bootstrap 4 Framework uses wrong classes for input group & no classes for checkbox HOT 8
- Can Former be used outside/without Laravel? HOT 2
- Multiple attributes treated differently from single attribute in queryToArray
- Form echo like a text Laravel 5.7
- Encode checkbox value to prevent XSS attack HOT 1
- Bootstrap 4 throws error without open and close tag HOT 2
- How to style checkboxes HOT 6
- Laravel 8 support. HOT 1
- How to use vuejs directives with former HOT 2
- Former::date help HOT 1
- _method HOT 2
- How to use as a standalone PHP HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from former.