about nette javascript verification – data-nette-rules on low level forms

Notice: This thread is very old.
alnux
Member | 139
+
+1
-

Hi again, could someone help me in how can i add data-nette-rules javascript on low level form fomat???

{foreach $items as $item}
    <p><input type=checkbox name="sel[]" value={$item->id}> {$item->name}</p>
{/foreach}

thanks

Last edited by alnux (2017-02-13 18:24)

Martk
Member | 661
+
+1
-
{foreach $items as $item}
    <p><input data-nette-rules="Json::encode(Helpers::exportRules($item->getRules()) ?: NULL)"> {$item->name}</p>
{/foreach}

You can create macro for easier usage

alnux
Member | 139
+
0
-

thanks

Martk wrote:

{foreach $items as $item}
    <p><input data-nette-rules="Json::encode(Helpers::exportRules($item->getRules()) ?: NULL)"> {$item->name}</p>
{/foreach}

You can create macro for easier usage