Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [ZendFramework] Zamiana kolejności pól formularza
nexis
post
Post #1





Grupa: Zarejestrowani
Postów: 1 012
Pomógł: 109
Dołączył: 26.09.2003
Skąd: nexis.pl

Ostrzeżenie: (0%)
-----


Tworzę formularz za pomocą Zend_Form:
  1. foreach ($optional as $key) {
  2. $this->addElement('checkbox', $key, array(
  3. 'required' => false,
  4. 'value' => '1'
  5. ));
  6. }

który generuje mniej więcej taki kod:
  1. <dl>
  2. <dt id="firstname-label">
  3. <label for="firstname" class="optional">
  4. Jan
  5. </label>
  6. </dt>
  7. <dd id="firstname-element">
  8. <input type="hidden" name="firstname" value="0" /><input type="checkbox" name="firstname" id="firstname" value="1" checked="checked" />
  9. </dd>
  10. <dt id="lastname-label">
  11. <label for="lastname" class="optional">
  12. Kowalski
  13. </label>
  14. </dt>
  15. <dd id="lastname-element">
  16. <input type="hidden" name="lastname" value="0" /><input type="checkbox" name="lastname" id="lastname" value="1" checked="checked" />
  17. </dd>
  18. </dl>

Powyższy kod daje taki widok:

Ja chciałbym jednak uzyskać następujący widok:


Za pomocą CSS chyba nie da rady, ponieważ element DT jest przed DD, stąd pomysł, żeby te dwa elementy zamienić kolejnością. Ale jak?


--------------------
Zend Certified Engineer

Kliknij POMÓGŁ jeśli moja odpowiedź okazała się użyteczna!
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 19.08.2025 - 11:04