<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Nette Framework forum :  :  : </title>
<link>http://forum.nette.org/cs</link>
<description> Nette Framework forum</description>
<language>cs</language>
<docs>http://backend.userland.com/rss</docs>
<item>
	<title>CKEditor a nefunkční JS validace (Formuláře)</title>
	<dc:creator>na1k</dc:creator>
	<link>http://forum.nette.org/cs/viewtopic.php?pid=37277#p37277</link>
	<guid isPermaLink="false">37277@http://forum.nette.org/cs</guid>
	<description>&lt;p&gt;Doplním své řešení – nelíbí se mi vazba na odesílací tlačítko,
tak vše řeším v configu (za předpokladu že používáte jQuery adapter).
Před odesláním formuláře se u všech CKEditorů ve stránce updatne
formulářový element. Dalo by se to ještě vylepšit, „hlídat“ jen
formuláře které obsahují editor a updatovat jen ten jeden konkrétní, ale
stačilo mi to takhle. JS validace samozřejmě funguje a v definici formu
není nutné nic víc, než nanejvýš nastavit css třídu pro textarea :)&lt;/p&gt;

&lt;pre class=&quot;html&quot;&gt;&lt;code&gt;&lt;span class=&quot;html-tag&quot;&gt;&amp;lt;script&amp;gt;&lt;/span&gt;&lt;span
class=&quot;js-out&quot;&gt;
$(&lt;/span&gt;&lt;span class=&quot;js-keywords1&quot;&gt;function&lt;/span&gt;&lt;span
class=&quot;js-out&quot;&gt;(){
   $(&lt;/span&gt;&lt;span
class=&quot;js-quote&quot;&gt;'textarea.editor'&lt;/span&gt;&lt;span
class=&quot;js-out&quot;&gt;).ckeditor(
      &lt;/span&gt;&lt;span
class=&quot;js-keywords1&quot;&gt;function&lt;/span&gt;&lt;span
class=&quot;js-out&quot;&gt;() {
         $(&lt;/span&gt;&lt;span class=&quot;js-quote&quot;&gt;'form'&lt;/span&gt;&lt;span
class=&quot;js-out&quot;&gt;).submit(&lt;/span&gt;&lt;span class=&quot;js-keywords1&quot;&gt;function&lt;/span&gt;&lt;span
class=&quot;js-out&quot;&gt;(){
            &lt;/span&gt;&lt;span class=&quot;js-keywords1&quot;&gt;for&lt;/span&gt;&lt;span
class=&quot;js-out&quot;&gt; (inst &lt;/span&gt;&lt;span class=&quot;js-keywords1&quot;&gt;in&lt;/span&gt;&lt;span
class=&quot;js-out&quot;&gt; CKEDITOR.instances)
               CKEDITOR.instances[inst].updateElement();
         });
      },
      {
         language : &lt;/span&gt;&lt;span
class=&quot;js-quote&quot;&gt;'cs'&lt;/span&gt;&lt;span
class=&quot;js-out&quot;&gt;,
         resize_dir : &lt;/span&gt;&lt;span
class=&quot;js-quote&quot;&gt;'vertical'&lt;/span&gt;&lt;span
class=&quot;js-out&quot;&gt;,
         ...
      }
   );
});
&lt;/span&gt;&lt;span
class=&quot;html-tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;!-- by Texy2! --&gt;</description>
	<pubDate>Sun, 15 Aug 2010 00:17:49 +0200</pubDate>
</item>
<item>
	<title>CKEditor a nefunkční JS validace (Formuláře)</title>
	<dc:creator>Endrju</dc:creator>
	<link>http://forum.nette.org/cs/viewtopic.php?pid=28440#p28440</link>
	<guid isPermaLink="false">28440@http://forum.nette.org/cs</guid>
	<description>&lt;p&gt;Etch: moc diky, nevedel jsem, ze to jde primo takto krasne a
jednoduse :)!&lt;/p&gt;</description>
	<pubDate>Sun, 07 Mar 2010 01:32:32 +0100</pubDate>
</item>
<item>
	<title>CKEditor a nefunkční JS validace (Formuláře)</title>
	<dc:creator>Etch</dc:creator>
	<link>http://forum.nette.org/cs/viewtopic.php?pid=28437#p28437</link>
	<guid isPermaLink="false">28437@http://forum.nette.org/cs</guid>
	<description>&lt;p&gt;ale v tom ti přece nic nebrání to tak udělat&lt;/p&gt;

&lt;pre class=&quot;src-php&quot;&gt;&lt;code&gt;&lt;span class=&quot;php-keyword1&quot;&gt;protected&lt;/span&gt; &lt;span
class=&quot;php-keyword1&quot;&gt;function&lt;/span&gt; createComponentNewsForm()
{
        &lt;span
class=&quot;php-var&quot;&gt;$form&lt;/span&gt; = &lt;span
class=&quot;php-keyword1&quot;&gt;new&lt;/span&gt; AppForm;

        &lt;span
class=&quot;php-var&quot;&gt;$renderer&lt;/span&gt; = &lt;span
class=&quot;php-var&quot;&gt;$form&lt;/span&gt;-&amp;gt;getRenderer();
        &lt;span
class=&quot;php-var&quot;&gt;$renderer&lt;/span&gt;-&amp;gt;wrappers[&lt;span
class=&quot;php-quote&quot;&gt;'label'&lt;/span&gt;][&lt;span
class=&quot;php-quote&quot;&gt;'container'&lt;/span&gt;] = &lt;span
class=&quot;php-keyword1&quot;&gt;NULL&lt;/span&gt;;

        &lt;span
class=&quot;php-var&quot;&gt;$form&lt;/span&gt;   -&amp;gt;addTextArea(&lt;span
class=&quot;php-quote&quot;&gt;'content'&lt;/span&gt;)
                -&amp;gt;addRule(Form::FILLED, &lt;span
class=&quot;php-quote&quot;&gt;'Vyplňte aktualitu prosím.'&lt;/span&gt;);

        &lt;span
class=&quot;php-var&quot;&gt;$form&lt;/span&gt;   -&amp;gt;addSubmit(&lt;span
class=&quot;php-quote&quot;&gt;'save'&lt;/span&gt;, &lt;span
class=&quot;php-quote&quot;&gt;'Uložit'&lt;/span&gt;)
                -&amp;gt;getControlPrototype()
                -&amp;gt;onclick(&lt;span
class=&quot;php-quote&quot;&gt;'CKEDITOR.instances[&amp;quot;'&lt;/span&gt;.&lt;span
class=&quot;php-var&quot;&gt;$form&lt;/span&gt;[&lt;span
class=&quot;php-quote&quot;&gt;'content'&lt;/span&gt;]-&amp;gt;getHtmlId().&lt;span
class=&quot;php-quote&quot;&gt;'&amp;quot;].updateElement()'&lt;/span&gt;)
                -&amp;gt;&lt;span
class=&quot;php-keyword1&quot;&gt;class&lt;/span&gt;(&lt;span
class=&quot;php-quote&quot;&gt;'default'&lt;/span&gt;);

        &lt;span
class=&quot;php-var&quot;&gt;$form&lt;/span&gt;   -&amp;gt;addSubmit(&lt;span
class=&quot;php-quote&quot;&gt;'cancel'&lt;/span&gt;, &lt;span
class=&quot;php-quote&quot;&gt;'Zrušit'&lt;/span&gt;)-&amp;gt;setValidationScope(&lt;span
class=&quot;php-keyword1&quot;&gt;NULL&lt;/span&gt;);

        &lt;span
class=&quot;php-var&quot;&gt;$form&lt;/span&gt;   -&amp;gt;addProtection(&lt;span
class=&quot;php-quote&quot;&gt;'Odešlete formulář znovu prosím (bezpečtnostní token vypršel).'&lt;/span&gt;);

        &lt;span
class=&quot;php-var&quot;&gt;$form&lt;/span&gt;   -&amp;gt;onSubmit[] = callback(&lt;span
class=&quot;php-var&quot;&gt;$this&lt;/span&gt;, &lt;span
class=&quot;php-quote&quot;&gt;'newsFormSubmitted'&lt;/span&gt;);

        &lt;span
class=&quot;php-keyword1&quot;&gt;return&lt;/span&gt; &lt;span
class=&quot;php-var&quot;&gt;$form&lt;/span&gt;;
}&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;je to naprosto stejné jako předtím jen se to navěsí na onClick událost
tlačítka Uložit.&lt;/p&gt;</description>
	<pubDate>Sun, 07 Mar 2010 00:52:28 +0100</pubDate>
</item>
<item>
	<title>CKEditor a nefunkční JS validace (Formuláře)</title>
	<dc:creator>Endrju</dc:creator>
	<link>http://forum.nette.org/cs/viewtopic.php?pid=28423#p28423</link>
	<guid isPermaLink="false">28423@http://forum.nette.org/cs</guid>
	<description>&lt;p&gt;Trochu jsem porovnaval vygenerovane HTML zdrojaky a pak zkousel upravovat
tovarnicku na formular. Zjistil jsem, co dela problem (coz vola po dalsim
reseni – viz. tucny text na konci prispevku..).&lt;/p&gt;

&lt;p&gt;Vsimete si v kodu toho, co jsem zakomentoval
(&lt;code&gt;-&amp;gt;setValidationScope(NULL)&lt;/code&gt;):&lt;/p&gt;

&lt;pre class=&quot;src-php&quot;&gt;&lt;code&gt;&lt;span class=&quot;php-keyword1&quot;&gt;protected&lt;/span&gt; &lt;span
class=&quot;php-keyword1&quot;&gt;function&lt;/span&gt; createComponentNewsForm()
{
        &lt;span
class=&quot;php-var&quot;&gt;$form&lt;/span&gt; = &lt;span
class=&quot;php-keyword1&quot;&gt;new&lt;/span&gt; AppForm;

        &lt;span
class=&quot;php-var&quot;&gt;$renderer&lt;/span&gt; = &lt;span
class=&quot;php-var&quot;&gt;$form&lt;/span&gt;-&amp;gt;getRenderer();
        &lt;span
class=&quot;php-var&quot;&gt;$renderer&lt;/span&gt;-&amp;gt;wrappers[&lt;span
class=&quot;php-quote&quot;&gt;'label'&lt;/span&gt;][&lt;span
class=&quot;php-quote&quot;&gt;'container'&lt;/span&gt;] = &lt;span
class=&quot;php-keyword1&quot;&gt;NULL&lt;/span&gt;;

        &lt;span
class=&quot;php-var&quot;&gt;$form&lt;/span&gt;-&amp;gt;addTextArea(&lt;span
class=&quot;php-quote&quot;&gt;'content'&lt;/span&gt;)
                -&amp;gt;addRule(Form::FILLED, &lt;span
class=&quot;php-quote&quot;&gt;'Vyplňte aktualitu prosím.'&lt;/span&gt;);

        &lt;span
class=&quot;php-var&quot;&gt;$form&lt;/span&gt;-&amp;gt;addSubmit(&lt;span
class=&quot;php-quote&quot;&gt;'save'&lt;/span&gt;, &lt;span
class=&quot;php-quote&quot;&gt;'Uložit'&lt;/span&gt;)-&amp;gt;getControlPrototype()-&amp;gt;&lt;span
class=&quot;php-keyword1&quot;&gt;class&lt;/span&gt;(&lt;span
class=&quot;php-quote&quot;&gt;'default'&lt;/span&gt;);
        &lt;span
class=&quot;php-var&quot;&gt;$form&lt;/span&gt;-&amp;gt;addSubmit(&lt;span
class=&quot;php-quote&quot;&gt;'cancel'&lt;/span&gt;, &lt;span
class=&quot;php-quote&quot;&gt;'Zrušit'&lt;/span&gt;);&lt;span
class=&quot;php-comment&quot;&gt;//-&amp;gt;setValidationScope(NULL);
&lt;/span&gt;
        &lt;span
class=&quot;php-var&quot;&gt;$this&lt;/span&gt;-&amp;gt;template-&amp;gt;textareaId = &lt;span
class=&quot;php-var&quot;&gt;$form&lt;/span&gt;[&lt;span
class=&quot;php-quote&quot;&gt;'content'&lt;/span&gt;]-&amp;gt;getHtmlId();

        &lt;span
class=&quot;php-var&quot;&gt;$form&lt;/span&gt;-&amp;gt;getElementPrototype()-&amp;gt;onsubmit(&lt;span
class=&quot;php-quote&quot;&gt;'CKEDITOR.instances[&amp;quot;'&lt;/span&gt;.&lt;span
class=&quot;php-var&quot;&gt;$this&lt;/span&gt;-&amp;gt;template-&amp;gt;textareaId.&lt;span
class=&quot;php-quote&quot;&gt;'&amp;quot;].updateElement()'&lt;/span&gt;);

        &lt;span
class=&quot;php-var&quot;&gt;$form&lt;/span&gt;-&amp;gt;onSubmit[] = callback(&lt;span
class=&quot;php-var&quot;&gt;$this&lt;/span&gt;, &lt;span
class=&quot;php-quote&quot;&gt;'newsFormSubmitted'&lt;/span&gt;);


        &lt;span
class=&quot;php-var&quot;&gt;$form&lt;/span&gt;-&amp;gt;addProtection(&lt;span
class=&quot;php-quote&quot;&gt;'Odešlete formulář znovu prosím (bezpečtnostní token vypršel).'&lt;/span&gt;);
        &lt;span
class=&quot;php-keyword1&quot;&gt;return&lt;/span&gt; &lt;span
class=&quot;php-var&quot;&gt;$form&lt;/span&gt;;
}&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;To, ze je na tlacitko „Zrusit“ nastaveno
&lt;code&gt;setValidationScope(NULL);&lt;/code&gt; zpusobi, validacni JS je mapovan na
submit tlacitko „Pridat“ na udalost &lt;code&gt;onClick&lt;/code&gt;. HTML pak kod
vypada takto:&lt;/p&gt;

&lt;pre class=&quot;src-htmlcb&quot;&gt;&lt;code&gt;&lt;span class=&quot;html-tag&quot;&gt;&amp;lt;form&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; action=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;/SK_Celadna/document_root/admin/news/add/?do=newsForm-submit&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; method=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;post&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; onsubmit=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;CKEDITOR.instances[&amp;amp;quot;frm-content&amp;amp;quot;].updateElement()&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; name=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;frm-newsForm&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tag&quot;&gt;&amp;gt;&lt;/span&gt;
        &lt;span
class=&quot;html-tag&quot;&gt;&amp;lt;table&amp;gt;&lt;/span&gt;
                &lt;span
class=&quot;html-tag&quot;&gt;&amp;lt;tr&lt;/span&gt;&lt;span class=&quot;html-tagin&quot;&gt; class=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;required&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tag&quot;&gt;&amp;gt;&lt;/span&gt;
                        &lt;span
class=&quot;html-tag&quot;&gt;&amp;lt;label&lt;/span&gt;&lt;span class=&quot;html-tagin&quot;&gt; class=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;required&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; for=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;frm-content&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tag&quot;&gt;&amp;gt;&lt;/span&gt;
                        &lt;span
class=&quot;html-tag&quot;&gt;&amp;lt;/label&amp;gt;&lt;/span&gt;
                        &lt;span
class=&quot;html-tag&quot;&gt;&amp;lt;td&amp;gt;&lt;/span&gt;
                                &lt;span
class=&quot;html-tag&quot;&gt;&amp;lt;textarea&lt;/span&gt;&lt;span class=&quot;html-tagin&quot;&gt; cols=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;40&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; rows=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;10&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; name=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;content&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; id=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;frm-content&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tag&quot;&gt;&amp;gt;&amp;lt;/textarea&amp;gt;&lt;/span&gt;
                                &lt;span
class=&quot;html-comment&quot;&gt;&amp;lt;!-- Zde na tomto miste je kod CKEditoru ... ten k tomu co chci ukazat nepotrebujem --&amp;gt;&lt;/span&gt;
                        &lt;span
class=&quot;html-tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
                &lt;span
class=&quot;html-tag&quot;&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
                &lt;span
class=&quot;html-tag&quot;&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
                        &lt;span
class=&quot;html-tag&quot;&gt;&amp;lt;td&amp;gt;&lt;/span&gt;
                                &lt;span
class=&quot;html-tag&quot;&gt;&amp;lt;input&lt;/span&gt;&lt;span class=&quot;html-tagin&quot;&gt; type=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;submit&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; class=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;default button&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; onclick=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;return nette.validateForm(this)&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; name=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;save&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; id=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;frmnewsForm-save&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; value=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;Přidat&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; /&lt;/span&gt;&lt;span
class=&quot;html-tag&quot;&gt;&amp;gt;&lt;/span&gt;
                                &lt;span
class=&quot;html-tag&quot;&gt;&amp;lt;input&lt;/span&gt;&lt;span class=&quot;html-tagin&quot;&gt; type=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;submit&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; class=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;button&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; name=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;cancel&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; id=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;frmnewsForm-cancel&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; value=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;Zrušit&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; /&lt;/span&gt;&lt;span
class=&quot;html-tag&quot;&gt;&amp;gt;&lt;/span&gt;
                        &lt;span
class=&quot;html-tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
                &lt;span
class=&quot;html-tag&quot;&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
        &lt;span
class=&quot;html-tag&quot;&gt;&amp;lt;/table&amp;gt;&lt;/span&gt;
        &lt;span
class=&quot;html-tag&quot;&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
                &lt;span
class=&quot;html-tag&quot;&gt;&amp;lt;input&lt;/span&gt;&lt;span class=&quot;html-tagin&quot;&gt; type=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;hidden&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; name=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;_token_&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; id=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;frmnewsForm-_token_&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; value=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;102e4bf43d9635e3abfbcd136a6c6842&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; /&lt;/span&gt;&lt;span class=&quot;html-tag&quot;&gt;&amp;gt;&lt;/span&gt;
        &lt;span
class=&quot;html-tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span
class=&quot;html-tag&quot;&gt;&amp;lt;/form&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;No a v tom je, zda se, kamen urazu.&lt;/p&gt;

&lt;p&gt;Kdyz totiz v tovarnicce zakomentuju &lt;code&gt;setValidationScope(NULL);&lt;/code&gt;
na tlacitku „Zrusit“, jak je uvedeno vyse, tak validacni JS, ktery byl
mapovan na submit tlacitko „Pridat“ na udalost &lt;code&gt;onClick&lt;/code&gt; se
presune na element „form“ do udalosti &lt;code&gt;onSubmit&lt;/code&gt; a pak to
„funguje“. HTML kod pak vypada takto:&lt;/p&gt;

&lt;pre class=&quot;src-htmlcb&quot;&gt;&lt;code&gt;&lt;span class=&quot;html-tag&quot;&gt;&amp;lt;form&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; name=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;frm-newsForm&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; onsubmit=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;CKEDITOR.instances[&amp;amp;quot;frm-content&amp;amp;quot;].updateElement();return nette.validateForm(this)&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; method=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;post&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; action=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;/SK_Celadna/document_root/admin/news/add/?do=newsForm-submit&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tag&quot;&gt;&amp;gt;&lt;/span&gt;
        &lt;span
class=&quot;html-tag&quot;&gt;&amp;lt;label&lt;/span&gt;&lt;span class=&quot;html-tagin&quot;&gt; for=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;frm-content&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; class=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;required&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tag&quot;&gt;&amp;gt;&lt;/span&gt;
        &lt;span
class=&quot;html-tag&quot;&gt;&amp;lt;/label&amp;gt;&lt;/span&gt;
        &lt;span
class=&quot;html-tag&quot;&gt;&amp;lt;table&amp;gt;&lt;/span&gt;
                &lt;span
class=&quot;html-tag&quot;&gt;&amp;lt;tbody&amp;gt;&lt;/span&gt;
                        &lt;span
class=&quot;html-tag&quot;&gt;&amp;lt;tr&lt;/span&gt;&lt;span class=&quot;html-tagin&quot;&gt; class=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;required&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tag&quot;&gt;&amp;gt;&lt;/span&gt;
                                &lt;span
class=&quot;html-tag&quot;&gt;&amp;lt;td&amp;gt;&lt;/span&gt;
                                        &lt;span
class=&quot;html-tag&quot;&gt;&amp;lt;textarea&lt;/span&gt;&lt;span class=&quot;html-tagin&quot;&gt; id=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;frm-content&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; name=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;content&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; rows=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;10&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; cols=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;40&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; style=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;visibility: hidden; display: none;&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tag&quot;&gt;&amp;gt;&amp;lt;/textarea&amp;gt;&lt;/span&gt;
                                        &lt;span
class=&quot;html-comment&quot;&gt;&amp;lt;!-- Zde na tomto miste je kod CKEditoru ... ten k tomu co chci ukazat nepotrebujem --&amp;gt;&lt;/span&gt;
                                &lt;span
class=&quot;html-tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
                        &lt;span
class=&quot;html-tag&quot;&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
                        &lt;span
class=&quot;html-tag&quot;&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
                                &lt;span
class=&quot;html-tag&quot;&gt;&amp;lt;td&amp;gt;&lt;/span&gt;
                                        &lt;span
class=&quot;html-tag&quot;&gt;&amp;lt;input&lt;/span&gt;&lt;span class=&quot;html-tagin&quot;&gt; type=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;submit&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; value=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;Přidat&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; id=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;frmnewsForm-save&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; name=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;save&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; class=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;default button&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tag&quot;&gt;&amp;gt;&lt;/span&gt;
                                        &lt;span
class=&quot;html-tag&quot;&gt;&amp;lt;input&lt;/span&gt;&lt;span class=&quot;html-tagin&quot;&gt; type=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;submit&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; value=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;Zrušit&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; id=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;frmnewsForm-cancel&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; name=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;cancel&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; class=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;button&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tag&quot;&gt;&amp;gt;&lt;/span&gt;
                                &lt;span
class=&quot;html-tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
                        &lt;span
class=&quot;html-tag&quot;&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
                &lt;span
class=&quot;html-tag&quot;&gt;&amp;lt;/tbody&amp;gt;&lt;/span&gt;
        &lt;span
class=&quot;html-tag&quot;&gt;&amp;lt;/table&amp;gt;&lt;/span&gt;
        &lt;span
class=&quot;html-tag&quot;&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
                &lt;span
class=&quot;html-tag&quot;&gt;&amp;lt;input&lt;/span&gt;&lt;span class=&quot;html-tagin&quot;&gt; type=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;hidden&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; value=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;102e4bf43d9635e3abfbcd136a6c6842&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; id=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;frmnewsForm-_token_&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; name=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;_token_&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tag&quot;&gt;&amp;gt;&lt;/span&gt;
        &lt;span
class=&quot;html-tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span
class=&quot;html-tag&quot;&gt;&amp;lt;/form&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Schvalne jsem napsal do uvozovek, ze to funguje, protoze to porad neni dobre
reseni.&lt;/p&gt;

&lt;p&gt;Kdyz ted stisknu tlacitko „Zrusit“, tak se stale provadi JS validace.
Validace je totiz nyni mapovana na cely formular (v udalosi onSubmit ve
formulari) a protoze tlacitko „Zrusit“ je take typu sumbmit, tak vyvolava JS
validaci.&lt;/p&gt;

&lt;p&gt;Ted by me zajimalo, zda je dobry napad, aby bylo ve formulari vice submit
tlacitek nez jen to jedine, ktere slouzi pro odeslani formulare?&lt;/p&gt;

&lt;p&gt;Paklize ano (muze byt takova situace, kdy to tak budu chtit), tak by JS
validace by mela byt mapovana prave a jen na stisknuti submit tlacitka
„Pridat“ tak, jak tomu je ve vychozim reseni z distribuce
&lt;code&gt;NetteFramework-0.9.3-PHP5.2\examples\CD-collection&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tedy otazka k reseni zni: Jak presunout JS validaci jen na submit
tlacitko „Pridat“ tak, aby vysledne HTML vypadalo nasledovne (jen dedukuju,
ze takto by to asi melo vypadat)?&lt;/strong&gt;&lt;/p&gt;

&lt;pre class=&quot;src-htmlcb&quot;&gt;&lt;code&gt;&lt;span class=&quot;html-tag&quot;&gt;&amp;lt;form&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; action=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;/SK_Celadna/document_root/admin/news/add/?do=newsForm-submit&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; method=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;post&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; name=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;frm-newsForm&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tag&quot;&gt;&amp;gt;&lt;/span&gt;
        &lt;span
class=&quot;html-tag&quot;&gt;&amp;lt;table&amp;gt;&lt;/span&gt;
                &lt;span
class=&quot;html-tag&quot;&gt;&amp;lt;tr&lt;/span&gt;&lt;span class=&quot;html-tagin&quot;&gt; class=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;required&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tag&quot;&gt;&amp;gt;&lt;/span&gt;
                        &lt;span
class=&quot;html-tag&quot;&gt;&amp;lt;label&lt;/span&gt;&lt;span class=&quot;html-tagin&quot;&gt; class=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;required&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; for=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;frm-content&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tag&quot;&gt;&amp;gt;&lt;/span&gt;
                        &lt;span
class=&quot;html-tag&quot;&gt;&amp;lt;/label&amp;gt;&lt;/span&gt;
                        &lt;span
class=&quot;html-tag&quot;&gt;&amp;lt;td&amp;gt;&lt;/span&gt;
                                &lt;span
class=&quot;html-tag&quot;&gt;&amp;lt;textarea&lt;/span&gt;&lt;span class=&quot;html-tagin&quot;&gt; cols=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;40&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; rows=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;10&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; name=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;content&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; id=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;frm-content&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tag&quot;&gt;&amp;gt;&amp;lt;/textarea&amp;gt;&lt;/span&gt;
                                &lt;span
class=&quot;html-comment&quot;&gt;&amp;lt;!-- Zde na tomto miste je kod CKEditoru ... ten k tomu co chci ukazat nepotrebujem --&amp;gt;&lt;/span&gt;
                        &lt;span
class=&quot;html-tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
                &lt;span
class=&quot;html-tag&quot;&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
                &lt;span
class=&quot;html-tag&quot;&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
                        &lt;span
class=&quot;html-tag&quot;&gt;&amp;lt;td&amp;gt;&lt;/span&gt;
                                &lt;span
class=&quot;html-tag&quot;&gt;&amp;lt;input&lt;/span&gt;&lt;span class=&quot;html-tagin&quot;&gt; type=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;submit&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; class=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;default button&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; onclick=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;CKEDITOR.instances[&amp;amp;quot;frm-content&amp;amp;quot;].updateElement();return nette.validateForm(this)&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; name=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;save&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; id=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;frmnewsForm-save&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; value=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;Přidat&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; /&lt;/span&gt;&lt;span
class=&quot;html-tag&quot;&gt;&amp;gt;&lt;/span&gt;
                                &lt;span
class=&quot;html-tag&quot;&gt;&amp;lt;input&lt;/span&gt;&lt;span class=&quot;html-tagin&quot;&gt; type=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;submit&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; class=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;button&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; name=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;cancel&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; id=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;frmnewsForm-cancel&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; value=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;Zrušit&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; /&lt;/span&gt;&lt;span
class=&quot;html-tag&quot;&gt;&amp;gt;&lt;/span&gt;
                        &lt;span
class=&quot;html-tag&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
                &lt;span
class=&quot;html-tag&quot;&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
        &lt;span
class=&quot;html-tag&quot;&gt;&amp;lt;/table&amp;gt;&lt;/span&gt;
        &lt;span
class=&quot;html-tag&quot;&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
                &lt;span
class=&quot;html-tag&quot;&gt;&amp;lt;input&lt;/span&gt;&lt;span class=&quot;html-tagin&quot;&gt; type=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;hidden&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; name=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;_token_&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; id=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;frmnewsForm-_token_&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; value=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;102e4bf43d9635e3abfbcd136a6c6842&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; /&lt;/span&gt;&lt;span class=&quot;html-tag&quot;&gt;&amp;gt;&lt;/span&gt;
        &lt;span
class=&quot;html-tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span
class=&quot;html-tag&quot;&gt;&amp;lt;/form&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;</description>
	<pubDate>Sat, 06 Mar 2010 16:22:54 +0100</pubDate>
</item>
<item>
	<title>CKEditor a nefunkční JS validace (Formuláře)</title>
	<dc:creator>Tharos</dc:creator>
	<link>http://forum.nette.org/cs/viewtopic.php?pid=28393#p28393</link>
	<guid isPermaLink="false">28393@http://forum.nette.org/cs</guid>
	<description>&lt;p&gt;Etch: No jo, vždyť jsem vů… To je tak, když člověk něco zkouší
narychlo a mozek má někde o projekt vedle.&lt;/p&gt;

&lt;p&gt;Takže to samozřejmě funguje, &lt;a href=&quot;http://uloz.to/4186837/ckeditor.zip&quot;
rel=&quot;nofollow&quot;&gt;zde&lt;/a&gt; je kompletní příklad s CKEditorem a fungující JS
validací.&lt;/p&gt;</description>
	<pubDate>Sat, 06 Mar 2010 10:36:03 +0100</pubDate>
</item>
<item>
	<title>CKEditor a nefunkční JS validace (Formuláře)</title>
	<dc:creator>Etch</dc:creator>
	<link>http://forum.nette.org/cs/viewtopic.php?pid=28388#p28388</link>
	<guid isPermaLink="false">28388@http://forum.nette.org/cs</guid>
	<description>&lt;p&gt;Endrju :&lt;/p&gt;

&lt;p&gt;Zkoušel sem to na Nette 1.0dev s CKEditorem 3.2 a funguje to naprosto bez
problému.&lt;/p&gt;

&lt;blockquote&gt;
	&lt;p&gt;Tharos napsal(a): Hmm, tak jsem zjistil, že ani má situace není ideální.
	S tím zápisem mi to pozná, že obsah toho elementu není prázdnej (asi teda
	nějak záhadně, budu muset prozkoumat, co se tam vlastně děje), ale
	složitější validační pravidla (jako třeba minimální délka textu) mi
	taky nefungují. Ještě se na to teda taky blíž podívám.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;To že ti nefunguje minimální délka textu a další věci je naprosto
normální a není na tom moc co zkoumat. Pokud napíšeš v CKEditoru jen
jedné písmeno „A“ tak se validace bude chovat následovně.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Min 3 znaky - Projde
Max 5 znaků - Neprojde
Min 8 znaků - Projde
Min 9 znaků - Neprojde&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;K validaci přijdou data už jako html tedy &lt;strong&gt;A&lt;/strong&gt; =
&lt;strong&gt;&amp;lt;p&amp;gt;A&amp;lt;/p&amp;gt;&lt;/strong&gt; v tom je celá nesrovnalost.&lt;/p&gt;</description>
	<pubDate>Sat, 06 Mar 2010 06:22:50 +0100</pubDate>
</item>
<item>
	<title>CKEditor a nefunkční JS validace (Formuláře)</title>
	<dc:creator>Endrju</dc:creator>
	<link>http://forum.nette.org/cs/viewtopic.php?pid=28387#p28387</link>
	<guid isPermaLink="false">28387@http://forum.nette.org/cs</guid>
	<description>&lt;p&gt;&lt;strong&gt;to redhead:&lt;/strong&gt; Zatim jestse ani nevim jak se ajaxove formulare
zapinaji. Vychazim z ukazkove aplikace &lt;strong&gt;modules-usage&lt;/strong&gt;
z distribuce &lt;code&gt;NetteFramework-0.9.3-PHP5.2\examples\modules-usage&lt;/code&gt;,
takze si myslim, ze ajaxove formulare nepouzivam.&lt;/p&gt;

&lt;p&gt;Zkuste vzit tuto ukazku, udelat si tovarnicku na formular s text areou. Na
ni pak v sablone namapovat CKEditor (mam verzi 3.1, ve verzi 3.2 zlobilo &lt;a
href=&quot;http://forum.nette.org/cs/3774-ckeditor-3-2-vykreslovani-dialogu-a-nette-problem&quot;
rel=&quot;nofollow&quot;&gt;vykreslování dialogů&lt;/a&gt;) a rozchodit JS validaci. Bez
CKEditoru to funguje v poradku.&lt;/p&gt;

&lt;p&gt;Neslo by sem zavolat Davida, aby se podival v cem by mohl byt problem?&lt;/p&gt;</description>
	<pubDate>Sat, 06 Mar 2010 03:26:47 +0100</pubDate>
</item>
<item>
	<title>CKEditor a nefunkční JS validace (Formuláře)</title>
	<dc:creator>redhead</dc:creator>
	<link>http://forum.nette.org/cs/viewtopic.php?pid=28364#p28364</link>
	<guid isPermaLink="false">28364@http://forum.nette.org/cs</guid>
	<description>&lt;p&gt;nějak jsem si to spojil s jiným příspěvkem, takže jsem do toho
zamíchal i ajax.. takže co sem napsal je asi blbost. Nicméně se zeptám,
nepoužíváš ajaxové formuláře? Pokud ne, je opravdu divné, že se ti
nespustí ani ten alert v onsubmit.&lt;/p&gt;</description>
	<pubDate>Fri, 05 Mar 2010 18:43:03 +0100</pubDate>
</item>
<item>
	<title>CKEditor a nefunkční JS validace (Formuláře)</title>
	<dc:creator>Endrju</dc:creator>
	<link>http://forum.nette.org/cs/viewtopic.php?pid=28361#p28361</link>
	<guid isPermaLink="false">28361@http://forum.nette.org/cs</guid>
	<description>&lt;p&gt;&lt;strong&gt;to redhead:&lt;/strong&gt; omlouvam se, ale nejsem tak sbehly co se techot
veci tyka, mohl by jsi napat kusy kodu na kterych bych dokazal vycist jake
presne upravy mam udelat, aby to bylo tak jak rikas?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;to Tharos:&lt;/strong&gt; Dobre, byl bych moc rad, kdyby se ti to podarilo
vyresit a napsal pak sem reseni.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;A pro vsechny ostatni:&lt;/em&gt; Kdyby jste nahodou vedeli, jak to udelat,
mohli by jste sem napsat veskery kod potrebnych uprav?&lt;/p&gt;

&lt;p&gt;Dekuji!&lt;/p&gt;</description>
	<pubDate>Fri, 05 Mar 2010 18:33:26 +0100</pubDate>
</item>
<item>
	<title>CKEditor a nefunkční JS validace (Formuláře)</title>
	<dc:creator>Tharos</dc:creator>
	<link>http://forum.nette.org/cs/viewtopic.php?pid=28358#p28358</link>
	<guid isPermaLink="false">28358@http://forum.nette.org/cs</guid>
	<description>&lt;p&gt;Hmm, tak jsem zjistil, že ani má situace není ideální. S tím zápisem
mi to pozná, že obsah toho elementu není prázdnej (asi teda nějak
záhadně, budu muset prozkoumat, co se tam vlastně děje), ale složitější
validační pravidla (jako třeba minimální délka textu) mi taky nefungují.
Ještě se na to teda taky blíž podívám.&lt;/p&gt;</description>
	<pubDate>Fri, 05 Mar 2010 18:09:18 +0100</pubDate>
</item>
<item>
	<title>CKEditor a nefunkční JS validace (Formuláře)</title>
	<dc:creator>redhead</dc:creator>
	<link>http://forum.nette.org/cs/viewtopic.php?pid=28357#p28357</link>
	<guid isPermaLink="false">28357@http://forum.nette.org/cs</guid>
	<description>&lt;p&gt;zkus to udělat přes jQuery, a to tak, že všem formulářům
s CKEditorem, zaregistruješ event handler pro submit, ale (teď je to
důležité:) musí být zaregistrován dříve, než ajaxová registrace, aby
to šlo popořadě. Protože mám pocit, že ti to ten kód nespustí proto, že
ajaxový handler volá na konci ‚return false‘, který zamezuje vykonání
dalšího kódu tohoto eventu.&lt;/p&gt;</description>
	<pubDate>Fri, 05 Mar 2010 18:09:01 +0100</pubDate>
</item>
<item>
	<title>CKEditor a nefunkční JS validace (Formuláře)</title>
	<dc:creator>Endrju</dc:creator>
	<link>http://forum.nette.org/cs/viewtopic.php?pid=28350#p28350</link>
	<guid isPermaLink="false">28350@http://forum.nette.org/cs</guid>
	<description>&lt;blockquote&gt;
	&lt;p&gt;honzakuchar napsal(a):&lt;/p&gt;

	&lt;p&gt;Updatoval jsem příspěvek #11&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Jo, upravil jsem to tak a vysledne HTML je:&lt;/p&gt;

&lt;pre class=&quot;src-htmlcb&quot;&gt;&lt;code&gt;&lt;span class=&quot;html-tag&quot;&gt;&amp;lt;form&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; ... onsubmit=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;CKEDITOR.instances['frm-content'].updateElement()&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; name=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;frm-newsForm&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Ale porad to nefunguje.&lt;/p&gt;

&lt;p&gt;Kdyz v API je u &lt;a
href=&quot;http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.editor.html#updateElement&quot;
rel=&quot;nofollow&quot;&gt;updateElement()&lt;/a&gt; napasno, ze by kod mel byt
&lt;code&gt;CKEDITOR.instances.editor1.updateElement();&lt;/code&gt;, tak nemelo by to
vysledne HTML vypadat spise takto:&lt;/p&gt;

&lt;pre class=&quot;src-htmlcb&quot;&gt;&lt;code&gt;&lt;span class=&quot;html-tag&quot;&gt;&amp;lt;form&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; ... onsubmit=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;CKEDITOR.instances.frm-content.updateElement()&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; name=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;frm-newsForm&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Nicmene tohle jsem zkousel taky a nic.&lt;/p&gt;

&lt;p&gt;Tak jsem zkusil takovy experiment a napsal do tovarnicky na formluar:&lt;/p&gt;

&lt;pre class=&quot;src-php&quot;&gt;&lt;code&gt;&lt;span
class=&quot;php-var&quot;&gt;$form&lt;/span&gt;-&amp;gt;getElementPrototype()-&amp;gt;onsubmit(&lt;span
class=&quot;php-quote&quot;&gt;'alert(\'ahoj\');'&lt;/span&gt;);&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;coz vygeneruje:&lt;/p&gt;

&lt;pre class=&quot;src-htmlcb&quot;&gt;&lt;code&gt;&lt;span class=&quot;html-tag&quot;&gt;&amp;lt;form&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; ... onsubmit=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;alert('ahoj');&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; name=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;frm-newsForm&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;ale po submit formulare to tento alert stejne nevypise. Neni neco spatne
uplne nekde jinde? Nebo cela myslenka?&lt;/p&gt;</description>
	<pubDate>Fri, 05 Mar 2010 17:25:42 +0100</pubDate>
</item>
<item>
	<title>CKEditor a nefunkční JS validace (Formuláře)</title>
	<dc:creator>Tharos</dc:creator>
	<link>http://forum.nette.org/cs/viewtopic.php?pid=28349#p28349</link>
	<guid isPermaLink="false">28349@http://forum.nette.org/cs</guid>
	<description>&lt;blockquote&gt;
	&lt;p&gt;Endrju napsal(a): Kdyz jsi psal, ze jsi to takto stejne resil, tak se podivat
	jak presne to mas, zda to odpovida to co pises tady.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Pošlu Ti skeleton i s CKčkem, kde to funguje. Dej mi jenom
vteřinku. :)&lt;/p&gt;</description>
	<pubDate>Fri, 05 Mar 2010 17:23:28 +0100</pubDate>
</item>
<item>
	<title>CKEditor a nefunkční JS validace (Formuláře)</title>
	<dc:creator>Honza Kuchař</dc:creator>
	<link>http://forum.nette.org/cs/viewtopic.php?pid=28345#p28345</link>
	<guid isPermaLink="false">28345@http://forum.nette.org/cs</guid>
	<description>&lt;p&gt;Updatoval jsem příspěvek #11&lt;/p&gt;</description>
	<pubDate>Fri, 05 Mar 2010 17:11:13 +0100</pubDate>
</item>
<item>
	<title>CKEditor a nefunkční JS validace (Formuláře)</title>
	<dc:creator>Endrju</dc:creator>
	<link>http://forum.nette.org/cs/viewtopic.php?pid=28344#p28344</link>
	<guid isPermaLink="false">28344@http://forum.nette.org/cs</guid>
	<description>&lt;p&gt;Napsal jsem to tedy takto:&lt;/p&gt;

&lt;pre class=&quot;src-php&quot;&gt;&lt;code&gt;&lt;span
class=&quot;php-var&quot;&gt;$form&lt;/span&gt;-&amp;gt;getElementPrototype()-&amp;gt;onsubmit(&lt;span
class=&quot;php-quote&quot;&gt;'CKEDITOR.instances['&lt;/span&gt;.&lt;span
class=&quot;php-var&quot;&gt;$form&lt;/span&gt;[&lt;span
class=&quot;php-quote&quot;&gt;'content'&lt;/span&gt;]-&amp;gt;getHtmlId().&lt;span
class=&quot;php-quote&quot;&gt;'].updateElement()'&lt;/span&gt;);&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Vygenerovalo to:&lt;/p&gt;

&lt;pre class=&quot;src-htmlcb&quot;&gt;&lt;code&gt;&lt;span class=&quot;html-tag&quot;&gt;&amp;lt;form&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; ... onsubmit=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;CKEDITOR.instances[frm-content].updateElement()&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; name=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;frm-newsForm&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;A stale to nefuguje – sposuti se JS validace, ktera mi rika, ze jsem
nezadal zadny text.&lt;/p&gt;

&lt;p&gt;Neudelal jsem neco spatne? Neni v Nette neco jinak?&lt;/p&gt;

&lt;p&gt;Kdyz jsi psal, ze jsi to takto stejne resil, tak se podivat jak presne to
mas, zda to odpovida to co pises tady.&lt;/p&gt;</description>
	<pubDate>Fri, 05 Mar 2010 17:10:01 +0100</pubDate>
</item>
<item>
	<title>CKEditor a nefunkční JS validace (Formuláře)</title>
	<dc:creator>Honza Kuchař</dc:creator>
	<link>http://forum.nette.org/cs/viewtopic.php?pid=28343#p28343</link>
	<guid isPermaLink="false">28343@http://forum.nette.org/cs</guid>
	<description>&lt;blockquote&gt;
	&lt;p&gt;Endrju napsal(a):&lt;/p&gt;

	&lt;p&gt;No a nemuze byt spatne ten zapis:&lt;/p&gt;

	&lt;pre class=&quot;src-php&quot;&gt;&lt;code&gt;&lt;span
	class=&quot;php-var&quot;&gt;$form&lt;/span&gt;-&amp;gt;getElementPrototype()-&amp;gt;onsubmit(&lt;span
	class=&quot;php-quote&quot;&gt;'CKEDITOR.instances[&amp;quot;'&lt;/span&gt;.&lt;span
	class=&quot;php-var&quot;&gt;$form&lt;/span&gt;[&lt;span
	class=&quot;php-quote&quot;&gt;'content'&lt;/span&gt;]-&amp;gt;getHtmlId().&lt;span
	class=&quot;php-quote&quot;&gt;'&amp;quot;].updateElement()'&lt;/span&gt;);&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;protoze, kdyz se podivam do HTML zdroje, tak pak mam ve formulari
	vygenerovano toto:&lt;/p&gt;

	&lt;pre class=&quot;src-htmlcb&quot;&gt;&lt;code&gt;&lt;span class=&quot;html-tag&quot;&gt;&amp;lt;form&lt;/span&gt;&lt;span
	class=&quot;html-tagin&quot;&gt; ... onsubmit=&lt;/span&gt;&lt;span
	class=&quot;html-quote&quot;&gt;&amp;quot;CKEDITOR.instances[&amp;amp;quot;frm-content&amp;amp;quot;].updateElement()&amp;quot;&lt;/span&gt;&lt;span
	class=&quot;html-tagin&quot;&gt; name=&lt;/span&gt;&lt;span
	class=&quot;html-quote&quot;&gt;&amp;quot;frm-newsForm&amp;quot;&lt;/span&gt;&lt;span
	class=&quot;html-tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/blockquote&gt;

&lt;p&gt;použij &lt;code&gt;'&lt;/code&gt;. Tj.&lt;/p&gt;

&lt;pre class=&quot;src-php&quot;&gt;&lt;code&gt;&lt;span
class=&quot;php-var&quot;&gt;$form&lt;/span&gt;-&amp;gt;getElementPrototype()-&amp;gt;onsubmit(&lt;span
class=&quot;php-quote&quot;&gt;'CKEDITOR.instances[\''&lt;/span&gt;.&lt;span
class=&quot;php-var&quot;&gt;$form&lt;/span&gt;[&lt;span
class=&quot;php-quote&quot;&gt;'content'&lt;/span&gt;]-&amp;gt;getHtmlId().&lt;span
class=&quot;php-quote&quot;&gt;'\'].updateElement()'&lt;/span&gt;);&lt;/code&gt;&lt;/pre&gt;</description>
	<pubDate>Fri, 05 Mar 2010 17:09:54 +0100</pubDate>
</item>
<item>
	<title>CKEditor a nefunkční JS validace (Formuláře)</title>
	<dc:creator>Tharos</dc:creator>
	<link>http://forum.nette.org/cs/viewtopic.php?pid=28342#p28342</link>
	<guid isPermaLink="false">28342@http://forum.nette.org/cs</guid>
	<description>&lt;p&gt;Zkus to ještě bez těch uvozovek (tj. jenom s těmi apostrofy), nedošlo
mi, že to je kontext, ve kterém Nette v šablonách escapuje.&lt;/p&gt;</description>
	<pubDate>Fri, 05 Mar 2010 17:04:30 +0100</pubDate>
</item>
<item>
	<title>CKEditor a nefunkční JS validace (Formuláře)</title>
	<dc:creator>Endrju</dc:creator>
	<link>http://forum.nette.org/cs/viewtopic.php?pid=28339#p28339</link>
	<guid isPermaLink="false">28339@http://forum.nette.org/cs</guid>
	<description>&lt;p&gt;No a nemuze byt spatne ten zapis:&lt;/p&gt;

&lt;pre class=&quot;src-php&quot;&gt;&lt;code&gt;&lt;span
class=&quot;php-var&quot;&gt;$form&lt;/span&gt;-&amp;gt;getElementPrototype()-&amp;gt;onsubmit(&lt;span
class=&quot;php-quote&quot;&gt;'CKEDITOR.instances[&amp;quot;'&lt;/span&gt;.&lt;span
class=&quot;php-var&quot;&gt;$form&lt;/span&gt;[&lt;span
class=&quot;php-quote&quot;&gt;'content'&lt;/span&gt;]-&amp;gt;getHtmlId().&lt;span
class=&quot;php-quote&quot;&gt;'&amp;quot;].updateElement()'&lt;/span&gt;);&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;protoze, kdyz se podivam do HTML zdroje, tak pak mam ve formulari
vygenerovano toto:&lt;/p&gt;

&lt;pre class=&quot;src-htmlcb&quot;&gt;&lt;code&gt;&lt;span class=&quot;html-tag&quot;&gt;&amp;lt;form&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; ... onsubmit=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;CKEDITOR.instances[&amp;amp;quot;frm-content&amp;amp;quot;].updateElement()&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; name=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;frm-newsForm&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;</description>
	<pubDate>Fri, 05 Mar 2010 17:01:11 +0100</pubDate>
</item>
<item>
	<title>CKEditor a nefunkční JS validace (Formuláře)</title>
	<dc:creator>Tharos</dc:creator>
	<link>http://forum.nette.org/cs/viewtopic.php?pid=28335#p28335</link>
	<guid isPermaLink="false">28335@http://forum.nette.org/cs</guid>
	<description>&lt;p&gt;To je opravdu zvláštní, zkus debugovat, proč u tebe ta metoda
updateElement() nepracuje podle předpokladů. Já ji ve formulářích
používám bez problémů a její použití mi připadá jako takové
nejhezčí řešení. Kdyžtak koukni ještě třeba na &lt;a
href=&quot;http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.editor.html#updateElement&quot;
rel=&quot;nofollow&quot;&gt;api&lt;/a&gt;.&lt;/p&gt;</description>
	<pubDate>Fri, 05 Mar 2010 16:47:50 +0100</pubDate>
</item>
<item>
	<title>CKEditor a nefunkční JS validace (Formuláře)</title>
	<dc:creator>Endrju</dc:creator>
	<link>http://forum.nette.org/cs/viewtopic.php?pid=28332#p28332</link>
	<guid isPermaLink="false">28332@http://forum.nette.org/cs</guid>
	<description>&lt;p&gt;Trochu jsem jeste patral v samples dodanych u CKEditoru a zjistil jsem
nasledujici:&lt;/p&gt;

&lt;p&gt;V souboru &lt;code&gt;/ckeditor/_samples/api.html&lt;/code&gt; je nasledujici JS funkce,
ktera vraci obsah editoru:&lt;/p&gt;

&lt;pre class=&quot;src-js&quot;&gt;&lt;code&gt;&lt;span class=&quot;js-keywords1&quot;&gt;function&lt;/span&gt;&lt;span
class=&quot;js-out&quot;&gt; GetContents()
{
        &lt;/span&gt;&lt;span
class=&quot;js-comment&quot;&gt;// Get the editor instance that we want to interact with.
&lt;/span&gt;&lt;span
class=&quot;js-out&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;js-keywords1&quot;&gt;var&lt;/span&gt;&lt;span
class=&quot;js-out&quot;&gt; oEditor = CKEDITOR.instances.editor1; &lt;/span&gt;&lt;span
class=&quot;js-comment&quot;&gt;// editor1 predstavuje ID textarea - tedy muj 'content'
&lt;/span&gt;&lt;span
class=&quot;js-out&quot;&gt;
        &lt;/span&gt;&lt;span
class=&quot;js-comment&quot;&gt;// Get the editor contents
&lt;/span&gt;&lt;span
class=&quot;js-out&quot;&gt;        alert( oEditor.getData() );
}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Kdyz tuto funkci upravim pouzitim funkce &lt;a
href=&quot;http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dom.element.html#getText&quot;
rel=&quot;nofollow&quot;&gt;getText()&lt;/a&gt;, tak bude vracet inner text tech HTML prvku.&lt;/p&gt;

&lt;p&gt;Ovsem v popisu metody mimo jine sotji: &lt;code&gt;Only in IE (which uses
innerText)&lt;/code&gt; nebude to pusobit potize v jinych prohlizecich? (ve Firefoxu
mi to jde)&lt;/p&gt;

&lt;p&gt;Kod pak bude vypadat takto:&lt;/p&gt;

&lt;pre class=&quot;src-js&quot;&gt;&lt;code&gt;&lt;span class=&quot;js-keywords1&quot;&gt;function&lt;/span&gt;&lt;span
class=&quot;js-out&quot;&gt; GetContents()
{
        &lt;/span&gt;&lt;span
class=&quot;js-comment&quot;&gt;// Get the editor instance that we want to interact with.
&lt;/span&gt;&lt;span
class=&quot;js-out&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;js-keywords1&quot;&gt;var&lt;/span&gt;&lt;span
class=&quot;js-out&quot;&gt; oEditor = CKEDITOR.instances.editor1;

        &lt;/span&gt;&lt;span
class=&quot;js-comment&quot;&gt;// Get the editor contents
&lt;/span&gt;&lt;span
class=&quot;js-out&quot;&gt;        &lt;/span&gt;&lt;span class=&quot;js-keywords1&quot;&gt;var&lt;/span&gt;&lt;span
class=&quot;js-out&quot;&gt; html = oEditor.getData();

        &lt;/span&gt;&lt;span
class=&quot;js-keywords1&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;js-out&quot;&gt;  (html == &lt;/span&gt;&lt;span
class=&quot;js-quote&quot;&gt;''&lt;/span&gt;&lt;span
class=&quot;js-out&quot;&gt;)
        {
                alert( &lt;/span&gt;&lt;span
class=&quot;js-quote&quot;&gt;'Editor neobsahuje zadny text (zadejte text)'&lt;/span&gt;&lt;span
class=&quot;js-out&quot;&gt; );
        }
        &lt;/span&gt;&lt;span
class=&quot;js-keywords1&quot;&gt;else&lt;/span&gt;&lt;span
class=&quot;js-out&quot;&gt;
        {
            &lt;/span&gt;&lt;span
class=&quot;js-keywords1&quot;&gt;var&lt;/span&gt;&lt;span
class=&quot;js-out&quot;&gt; element = CKEDITOR.dom.element.createFromHtml( oEditor.getData() );
                alert( element.getText() );  &lt;/span&gt;&lt;span
class=&quot;js-comment&quot;&gt;// &amp;quot;Sample text.&amp;quot;
&lt;/span&gt;&lt;span
class=&quot;js-out&quot;&gt;        }
}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Ted ale &lt;strong&gt;jak tohle zpracovat (upravit)&lt;/strong&gt;, abych to mohl
v tovarnicce na formular pouzit nejak takto:&lt;/p&gt;

&lt;pre class=&quot;src-php&quot;&gt;&lt;code&gt;&lt;span
class=&quot;php-var&quot;&gt;$form&lt;/span&gt;-&amp;gt;onSubmit[] = &lt;span
class=&quot;php-keyword2&quot;&gt;array&lt;/span&gt;(&lt;span class=&quot;php-var&quot;&gt;$this&lt;/span&gt;, &lt;span
class=&quot;php-quote&quot;&gt;'GetContents'&lt;/span&gt;);&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Dekuji za napady&lt;/p&gt;</description>
	<pubDate>Fri, 05 Mar 2010 16:24:28 +0100</pubDate>
</item>
<item>
	<title>CKEditor a nefunkční JS validace (Formuláře)</title>
	<dc:creator>Endrju</dc:creator>
	<link>http://forum.nette.org/cs/viewtopic.php?pid=28329#p28329</link>
	<guid isPermaLink="false">28329@http://forum.nette.org/cs</guid>
	<description>&lt;blockquote&gt;
	&lt;p&gt;redhead napsal(a):&lt;/p&gt;

	&lt;p&gt;&lt;a href=&quot;http://forum.nette.org/cs/2797-ckeditor-textarea-je-prazdny&quot;
	rel=&quot;nofollow&quot;&gt;http://forum.nette.org/…a-je-prazdny&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Dival jsem se co vse tam psali, ale v podstate tam neni napsano to vysledne
reseni. Nebo ho tam nevidim. Pochopil jsem, ze by bylo vhodne pouizit
neco jako:&lt;/p&gt;

&lt;pre class=&quot;src-php&quot;&gt;&lt;code&gt;&lt;span class=&quot;php-var&quot;&gt;$html&lt;/span&gt; = &lt;span
class=&quot;php-var&quot;&gt;$form&lt;/span&gt;-&amp;gt;getElementPrototype();
&lt;span
class=&quot;php-var&quot;&gt;$html&lt;/span&gt;-&amp;gt;onsubmit = &lt;span
class=&quot;php-quote&quot;&gt;&amp;quot;naplnTextAreaHodnotouZCKEditoru();&amp;quot;&lt;/span&gt;;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Coz by bylo idelani resni, ale nevim presne jak..&lt;/p&gt;

&lt;blockquote&gt;
	&lt;p&gt;Tharos napsal(a):&lt;/p&gt;

	&lt;p&gt;V továrničce můžeš ke konci definice formuláře s editorem
	přidat:&lt;/p&gt;

	&lt;pre class=&quot;php&quot;&gt;&lt;code&gt;&lt;span class=&quot;xlang&quot;&gt;&amp;lt;?php&lt;/span&gt;
&lt;span
	class=&quot;php-var&quot;&gt;$form&lt;/span&gt;-&amp;gt;getElementPrototype()-&amp;gt;onsubmit(&lt;span
	class=&quot;php-quote&quot;&gt;'CKEDITOR.instances[&amp;quot;'&lt;/span&gt;.&lt;span
	class=&quot;php-var&quot;&gt;$form&lt;/span&gt;[&lt;span
	class=&quot;php-quote&quot;&gt;'content'&lt;/span&gt;]-&amp;gt;getHtmlId().&lt;span
	class=&quot;php-quote&quot;&gt;'&amp;quot;].updateElement()'&lt;/span&gt;);
&lt;span
	class=&quot;xlang&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;kde $form[‚content‘] je nějaká textarea. Dělá to přesně to, co je
	zapotřebí – ještě před JS validací to uloží obsah editoru do
	textarea, které nahrazuje. Pak JS validace funguje. Předpokládá to
	vytváření instance CKEditoru nahrazením textarea podle jejího id.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Takhle jsem doufal, ze to nejak bude. Zkopiroval jsem to do kodu, ale
nefunguje to. Zrejmne je potreba neco upravit. Nevim jak dostat text toho
CKEditoru.. Zkousel jsem hledat v dokumentaci, jestli nemaji nejakou funkci,
kterou bych ten text vytahl, ale bud hledam spatne nebo jsem to prehledl.&lt;/p&gt;

&lt;p&gt;Kdyz jsem se dival pres Firebug, tak zdroj obsahuje toto:&lt;/p&gt;

&lt;p&gt;Moje TextArea (schovana CKEditorem):&lt;/p&gt;

&lt;pre class=&quot;src-htmlcb&quot;&gt;&lt;code&gt;&lt;span class=&quot;html-tag&quot;&gt;&amp;lt;textarea&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; id=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;frm-content&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; name=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;content&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; rows=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;10&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; cols=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;40&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; style=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;visibility: hidden; display: none;&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tag&quot;&gt;&amp;gt;&amp;lt;/textarea&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;A tady je kod CKEditoru, ktery nahrazuje moji TextArea (mozna takto nejsnaze
najdete to co bych potreboval):&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.pastebin.cz/3d1d97d1d2d491&quot;
rel=&quot;nofollow&quot;&gt;http://www.pastebin.cz/3d1d97d1d2d491&lt;/a&gt; (nechtěl jsem vkládat
celý zdroj tady, kvůli přehlednoti)&lt;/p&gt;

&lt;p&gt;Jeste pridavam dva odkazy na CKEditor dokomentaci.. treba by to slo nejak
pouzit (bohuzel tam nemaji nejake priklady..):&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;&lt;a
	href=&quot;http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dom.element.html#getHtml&quot;
	rel=&quot;nofollow&quot;&gt;getHtml()&lt;/a&gt;&lt;/li&gt;

	&lt;li&gt;&lt;a
	href=&quot;http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dom.element.html#getText&quot;
	rel=&quot;nofollow&quot;&gt;getText()&lt;/a&gt; (tohle by bylo lepsi, protože me zajima obsah jako
	text a ne to, že tam jsou nejake HTML znacky bez obsahu – tedy
	nejakeho textu)&lt;/li&gt;
&lt;/ul&gt;</description>
	<pubDate>Fri, 05 Mar 2010 15:53:21 +0100</pubDate>
</item>
<item>
	<title>CKEditor a nefunkční JS validace (Formuláře)</title>
	<dc:creator>Tharos</dc:creator>
	<link>http://forum.nette.org/cs/viewtopic.php?pid=28326#p28326</link>
	<guid isPermaLink="false">28326@http://forum.nette.org/cs</guid>
	<description>&lt;p&gt;V továrničce můžeš ke konci definice formuláře s editorem
přidat:&lt;/p&gt;

&lt;pre class=&quot;php&quot;&gt;&lt;code&gt;&lt;span class=&quot;xlang&quot;&gt;&amp;lt;?php&lt;/span&gt;
&lt;span
class=&quot;php-var&quot;&gt;$form&lt;/span&gt;-&amp;gt;getElementPrototype()-&amp;gt;onsubmit(&lt;span
class=&quot;php-quote&quot;&gt;'CKEDITOR.instances[&amp;quot;'&lt;/span&gt;.&lt;span
class=&quot;php-var&quot;&gt;$form&lt;/span&gt;[&lt;span
class=&quot;php-quote&quot;&gt;'content'&lt;/span&gt;]-&amp;gt;getHtmlId().&lt;span
class=&quot;php-quote&quot;&gt;'&amp;quot;].updateElement()'&lt;/span&gt;);
&lt;span
class=&quot;xlang&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;kde $form[‚content‘] je nějaká textarea. Dělá to přesně to, co je
zapotřebí – ještě před JS validací to uloží obsah editoru do
textarea, které nahrazuje. Pak JS validace funguje. Předpokládá to
vytváření instance CKEditoru nahrazením textarea podle jejího id.&lt;/p&gt;</description>
	<pubDate>Fri, 05 Mar 2010 15:32:12 +0100</pubDate>
</item>
<item>
	<title>CKEditor a nefunkční JS validace (Formuláře)</title>
	<dc:creator>redhead</dc:creator>
	<link>http://forum.nette.org/cs/viewtopic.php?pid=28325#p28325</link>
	<guid isPermaLink="false">28325@http://forum.nette.org/cs</guid>
	<description>&lt;p&gt;&lt;a href=&quot;http://forum.nette.org/cs/2797-ckeditor-textarea-je-prazdny&quot;
rel=&quot;nofollow&quot;&gt;http://forum.nette.org/…a-je-prazdny&lt;/a&gt;&lt;/p&gt;</description>
	<pubDate>Fri, 05 Mar 2010 15:10:34 +0100</pubDate>
</item>
<item>
	<title>CKEditor a nefunkční JS validace (Formuláře)</title>
	<dc:creator>Endrju</dc:creator>
	<link>http://forum.nette.org/cs/viewtopic.php?pid=28323#p28323</link>
	<guid isPermaLink="false">28323@http://forum.nette.org/cs</guid>
	<description>&lt;blockquote&gt;
	&lt;p&gt;honzakuchar napsal(a):&lt;/p&gt;

	&lt;p&gt;Pokud se to odešle, tak PHP validace fungovat bude.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;jj, diky, myslel jsem si že ano. Nicméně mě zaráží, že nefunguje ta
JS validace. Mám pocit, že tu snad bylo nějaké takové podobné vlákno, ale
nemohl jsem to najít. Mám dojem, že se tam psal něco o tom, že si to ten
CKEditor nějak cachuje (jinými slovy, že do odeslání nenaplňuje fyzicky tu
textarea). Tedy by se to snad měl dát nějak zjistit obsah CKEditoru nějakou
jeho funkcí a ten obsah pak předat našmu JScriptu? Zdá se mi to ale celé
nějaké složité a raději bych, aby to fungovalo standartním způsobem..&lt;/p&gt;

&lt;p&gt;Nevíte někdo jak to provést?&lt;/p&gt;</description>
	<pubDate>Fri, 05 Mar 2010 15:06:39 +0100</pubDate>
</item>
<item>
	<title>CKEditor a nefunkční JS validace (Formuláře)</title>
	<dc:creator>Honza Kuchař</dc:creator>
	<link>http://forum.nette.org/cs/viewtopic.php?pid=28320#p28320</link>
	<guid isPermaLink="false">28320@http://forum.nette.org/cs</guid>
	<description>&lt;p&gt;Pokud se to odešle, tak PHP validace fungovat bude.&lt;/p&gt;</description>
	<pubDate>Fri, 05 Mar 2010 14:52:59 +0100</pubDate>
</item>
<item>
	<title>CKEditor a nefunkční JS validace (Formuláře)</title>
	<dc:creator>Endrju</dc:creator>
	<link>http://forum.nette.org/cs/viewtopic.php?pid=28318#p28318</link>
	<guid isPermaLink="false">28318@http://forum.nette.org/cs</guid>
	<description>&lt;p&gt;Zdravím :)!&lt;/p&gt;

&lt;p&gt;Pořeboval bych poradit. Chci používat &lt;a href=&quot;http://ckeditor.com/&quot;
rel=&quot;nofollow&quot;&gt;CKEditor&lt;/a&gt; ve svých formulářích, ale nefunguje mi dobře
validace a nevím co s tím.&lt;/p&gt;

&lt;p&gt;Po pravdě, když dobře nefunguje JS validace a vypnul bych ji, tak si pak
nejsem jistý, zda by dobře fungovala i PHP validace. Měla by, ale rád bych
100% potvrzení :).&lt;/p&gt;

&lt;p&gt;Mám takto vytvořený formulář v presenteru:&lt;/p&gt;

&lt;pre class=&quot;src-php&quot;&gt;&lt;code&gt;&lt;span class=&quot;php-keyword1&quot;&gt;protected&lt;/span&gt; &lt;span
class=&quot;php-keyword1&quot;&gt;function&lt;/span&gt; createComponentNewsForm()
{
        &lt;span
class=&quot;php-var&quot;&gt;$form&lt;/span&gt; = &lt;span
class=&quot;php-keyword1&quot;&gt;new&lt;/span&gt; AppForm;

        &lt;span
class=&quot;php-var&quot;&gt;$renderer&lt;/span&gt; = &lt;span
class=&quot;php-var&quot;&gt;$form&lt;/span&gt;-&amp;gt;getRenderer();
        &lt;span
class=&quot;php-var&quot;&gt;$renderer&lt;/span&gt;-&amp;gt;wrappers[&lt;span
class=&quot;php-quote&quot;&gt;'label'&lt;/span&gt;][&lt;span
class=&quot;php-quote&quot;&gt;'container'&lt;/span&gt;] = &lt;span
class=&quot;php-keyword1&quot;&gt;NULL&lt;/span&gt;;

        &lt;span
class=&quot;php-var&quot;&gt;$form&lt;/span&gt;-&amp;gt;addTextArea(&lt;span
class=&quot;php-quote&quot;&gt;'content'&lt;/span&gt;)
                -&amp;gt;addRule(Form::FILLED, &lt;span
class=&quot;php-quote&quot;&gt;'Vyplňte aktualitu prosím.'&lt;/span&gt;);

        &lt;span
class=&quot;php-var&quot;&gt;$form&lt;/span&gt;-&amp;gt;addSubmit(&lt;span
class=&quot;php-quote&quot;&gt;'save'&lt;/span&gt;, &lt;span
class=&quot;php-quote&quot;&gt;'Uložit'&lt;/span&gt;)-&amp;gt;getControlPrototype()-&amp;gt;&lt;span
class=&quot;php-keyword1&quot;&gt;class&lt;/span&gt;(&lt;span
class=&quot;php-quote&quot;&gt;'default'&lt;/span&gt;);
        &lt;span
class=&quot;php-var&quot;&gt;$form&lt;/span&gt;-&amp;gt;addSubmit(&lt;span
class=&quot;php-quote&quot;&gt;'cancel'&lt;/span&gt;, &lt;span
class=&quot;php-quote&quot;&gt;'Zrušit'&lt;/span&gt;)-&amp;gt;setValidationScope(&lt;span
class=&quot;php-keyword1&quot;&gt;NULL&lt;/span&gt;);
        &lt;span
class=&quot;php-var&quot;&gt;$form&lt;/span&gt;-&amp;gt;onSubmit[] = callback(&lt;span
class=&quot;php-var&quot;&gt;$this&lt;/span&gt;, &lt;span
class=&quot;php-quote&quot;&gt;'newsFormSubmitted'&lt;/span&gt;);


        &lt;span
class=&quot;php-var&quot;&gt;$form&lt;/span&gt;-&amp;gt;addProtection(&lt;span
class=&quot;php-quote&quot;&gt;'Odešlete formulář znovu prosím (bezpečtnostní token vypršel).'&lt;/span&gt;);
        &lt;span
class=&quot;php-keyword1&quot;&gt;return&lt;/span&gt; &lt;span
class=&quot;php-var&quot;&gt;$form&lt;/span&gt;;
}&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;A takto vytvořenou šablonu pro tento formulář:&lt;/p&gt;

&lt;pre class=&quot;src-htmlcb&quot;&gt;&lt;code&gt;&lt;span class=&quot;xlang&quot;&gt;{&lt;/span&gt;&lt;span
class=&quot;php-keyword1&quot;&gt;block&lt;/span&gt; content&lt;span class=&quot;xlang&quot;&gt;}&lt;/span&gt;

&lt;span
class=&quot;html-tag&quot;&gt;&amp;lt;script&lt;/span&gt;&lt;span class=&quot;html-tagin&quot;&gt; type=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;text/javascript&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; src=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;{$basePath}/js/jquery-1.4.min.js&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;span
class=&quot;html-tag&quot;&gt;&amp;lt;script&lt;/span&gt;&lt;span class=&quot;html-tagin&quot;&gt; type=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;text/javascript&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; src=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;{$basePath}/js/ckeditor/ckeditor.js&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tag&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;span
class=&quot;html-tag&quot;&gt;&amp;lt;script&lt;/span&gt;&lt;span class=&quot;html-tagin&quot;&gt; type=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;text/javascript&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;js-out&quot;&gt;
&lt;/span&gt;&lt;span
class=&quot;js-comment&quot;&gt;/* &amp;lt;![CDATA[ */&lt;/span&gt;&lt;span
class=&quot;js-out&quot;&gt;
    jQuery(&lt;/span&gt;&lt;span
class=&quot;js-keywords2&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;js-out&quot;&gt;).ready(&lt;/span&gt;&lt;span
class=&quot;js-keywords1&quot;&gt;function&lt;/span&gt;&lt;span
class=&quot;js-out&quot;&gt;() {
        CKEDITOR.replace(&lt;/span&gt;&lt;span
class=&quot;js-quote&quot;&gt;'content'&lt;/span&gt;&lt;span class=&quot;js-out&quot;&gt;)
    });
&lt;/span&gt;&lt;span
class=&quot;js-comment&quot;&gt;/* ]]&amp;gt; */&lt;/span&gt;&lt;span class=&quot;js-out&quot;&gt;
&lt;/span&gt;&lt;span
class=&quot;html-tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;

&lt;span
class=&quot;html-tag&quot;&gt;&amp;lt;div&lt;/span&gt;&lt;span class=&quot;html-tagin&quot;&gt; id=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;title&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;xlang&quot;&gt;{&lt;/span&gt;&lt;span
class=&quot;php-keyword1&quot;&gt;include&lt;/span&gt; #title&lt;span class=&quot;xlang&quot;&gt;}&lt;/span&gt;&lt;span
class=&quot;html-tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

&lt;span
class=&quot;xlang&quot;&gt;{&lt;/span&gt;widget newsForm&lt;span class=&quot;xlang&quot;&gt;}&lt;/span&gt;

&lt;span
class=&quot;xlang&quot;&gt;{&lt;/span&gt;/&lt;span class=&quot;php-keyword1&quot;&gt;block&lt;/span&gt;&lt;span
class=&quot;xlang&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Prpblém je, že když vložím text jakkoli dlouhý (či prázdný), tak mi
pokaždé vyskočí JS validace, abych zadal text aktuality. Když validaci
&lt;code&gt;-&amp;gt;addRule(Form::FILLED, 'Vyplňte aktualitu prosím.')&lt;/code&gt;
odstraním, tak se záznam v pořádku do databáze uloží. Validaci ale
odtranit nechci.&lt;/p&gt;

&lt;p&gt;Dokázali by jste mi prosím poradit co jsem kde udělal špatně nebo
v čem je chyba? Děkuji moc!&lt;/p&gt;

&lt;!-- by Texy2! --&gt;</description>
	<pubDate>Fri, 05 Mar 2010 14:48:40 +0100</pubDate>
</item>
</channel>
</rss>
