|
| <prev next> |
QFC/smarty renderer - visibility: msg#00415php.pear.general
Hi! I have some elements in my form which should only be displayed to the user if he/she e.g. hits a specific radio-button in the first group. First I usually define the two groups via/in QF(C). Maybe this is useful for others, too : ------------- QuickForm --------------------- [..] $ele1[] = &HTML_QuickForm::createElement('radio', null, null, 'Yes', '1', array('onClick' => 'toggleNode(\'rowNumber4\')') ); $ele1[] = &HTML_QuickForm::createElement('radio', null, null, 'No', '0', array('onClick' => 'toggleNode(\'rowNumber4\')') ); $this->addGroup($list1, 'element1', 'Do you want to display the next Question?'); // only display if former question has been confirmed with 'yes' $ele2[] = &HTML_QuickForm::createElement('radio', null, null, 'To hell', '0' ); $ele2[] = &HTML_QuickForm::createElement('radio', null, null, 'To heaven', '1'); $this->addGroup($ele2, 'element2', 'Here is the optional question: Where do you want to go tomorrow?'); [..] ------------- /QuickForm --------------------- ------------- JavaScript in dyn. (smart)Template --------------------- {literal} <script language="JavaScript" type="text/javascript"> <!-- function toggleNode(el) { document.getElementById(el).style.display = document.getElementById(el).style.display == 'none'? document.all?"block":"table-row":"none"; } //--> </script> {/literal} ------------- /JavaScript in dyn. (smarty)Template --------------------- I am in need to let my dynamic template know that a group defined in quickform has the attribute visibility=0 -> which meens it wont be shown by default. my feelings says that such infos should be some more in the view, but actually i dont really know how to implement this in the template-logic , because how should the template know about it? We could use the seperator-value, but personally I dont really want to use this member variable in the wrong context. Is there another way to get around this problem and to hand over some additional information on a quickform-group to the template? Furthermore I dont really like putting javascript-calls in the QuickForm code (in createElement), but I dont really know how else to do so. I am using QFC + ArraySmarty-renderer. bye --M -- PEAR General Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Help using HTTP_Download: 00415, Craig H. Anderson |
|---|---|
| Previous by Thread: | [ANNOUNCEMENT] Net_NNTP-0.10.1 (alpha) Released.i: 00415, PEAR Announce |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |