Advertisement
Guest User

Untitled

a guest
Sep 13th, 2013
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.12 KB | None | 0 0
  1. // ----- This form does work correctly
  2. public function DirectForm() {
  3.         $f = BootstrapForm::create(
  4.             $this,
  5.             "DirectForm",
  6.             FieldList::create()->text("Notes", _t('Translations.NOTES','Notes on your product (scratches, etc.)')),
  7.             FieldList::create(/*...*/)
  8.         );
  9.  
  10.         //...
  11. }
  12.  
  13. /* ----- This one below outputs inputs with ID equal to the enclosing div
  14.  
  15. ie. instead of:
  16. <form id="BootstrapForm_DirectForm" ...>
  17.     ...
  18.     <div id="Notes">
  19.         ...
  20.         <input type="text" name="Notes" id="BootstrapForm_DirectForm_Notes">
  21.         ...
  22.     </div>
  23.     ...
  24. </form>
  25.  
  26. I get:
  27. <form id="BootstrapForm_DirectForm" ...>
  28.     ...
  29.     <div id="Notes">
  30.         ...
  31.         <input type="text" name="Notes" id="Notes">
  32.         ...
  33.     </div>
  34.     ...
  35. </form>
  36.  
  37.  
  38. Thus I have two elements with the same ID, making CSS styling impossible and making labels useless (clicking them do not focus the input)
  39. */
  40. public function DirectForm() {
  41.         $f = BootstrapForm::create(
  42.             $this,
  43.             "DirectForm",
  44.             FieldList::create(),
  45.             FieldList::create(/*...*/)
  46.         );
  47.  
  48.         $f->Fields()->text("Notes", _t('Translations.NOTES','Notes on your product (scratches, etc.)'));
  49.         //...
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement