Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ----- This form does work correctly
- public function DirectForm() {
- $f = BootstrapForm::create(
- $this,
- "DirectForm",
- FieldList::create()->text("Notes", _t('Translations.NOTES','Notes on your product (scratches, etc.)')),
- FieldList::create(/*...*/)
- );
- //...
- }
- /* ----- This one below outputs inputs with ID equal to the enclosing div
- ie. instead of:
- <form id="BootstrapForm_DirectForm" ...>
- ...
- <div id="Notes">
- ...
- <input type="text" name="Notes" id="BootstrapForm_DirectForm_Notes">
- ...
- </div>
- ...
- </form>
- I get:
- <form id="BootstrapForm_DirectForm" ...>
- ...
- <div id="Notes">
- ...
- <input type="text" name="Notes" id="Notes">
- ...
- </div>
- ...
- </form>
- Thus I have two elements with the same ID, making CSS styling impossible and making labels useless (clicking them do not focus the input)
- */
- public function DirectForm() {
- $f = BootstrapForm::create(
- $this,
- "DirectForm",
- FieldList::create(),
- FieldList::create(/*...*/)
- );
- $f->Fields()->text("Notes", _t('Translations.NOTES','Notes on your product (scratches, etc.)'));
- //...
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement