<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Forum CakePHP.org.pl - $ajax->observeField i błąd form is not defined]]></title>
	<link rel="self" href="http://forum.cakephp.org.pl/feed/atom/topic/61/"/>
	<updated>2009-04-23T13:57:14Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.cakephp.org.pl/topic/61/ajaxobservefield-i-blad-form-is-not-defined/</id>
		<entry>
			<title type="html"><![CDATA[Odp: $ajax->observeField i błąd form is not defined]]></title>
			<link rel="alternate" href="http://forum.cakephp.org.pl/post/280/#p280"/>
			<content type="html"><![CDATA[<p>Miałeś rację, prototype był źle podlinkowany. Konkretnie w default.ctp umieściłem:</p><div class="codebox"><pre><code>echo $javascript-&gt;link(array(&#039;prototype&#039;));</code></pre></div><p>W katalogu /home/meq/workdir/cake/app/webroot/js/prototype wrzuciłem plik: prototype-1.6.0.3.js<br />Zmiana nazwy na prototype.js załatwiła sprawę.</p><p>Dzięki bardzo za pomoc.</p>]]></content>
			<author>
				<name><![CDATA[zoltan]]></name>
				<uri>http://forum.cakephp.org.pl/user/166/</uri>
			</author>
			<updated>2009-04-23T13:57:14Z</updated>
			<id>http://forum.cakephp.org.pl/post/280/#p280</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Odp: $ajax->observeField i błąd form is not defined]]></title>
			<link rel="alternate" href="http://forum.cakephp.org.pl/post/276/#p276"/>
			<content type="html"><![CDATA[<p>Sam prototype, ale laduj zawsze oba, w ogole wyga tak jak by prototype byl nie podlinkowany, wklej mi kod linkujacy javascript u Ciebie.</p>]]></content>
			<author>
				<name><![CDATA[robal77]]></name>
				<uri>http://forum.cakephp.org.pl/user/143/</uri>
			</author>
			<updated>2009-04-23T07:39:00Z</updated>
			<id>http://forum.cakephp.org.pl/post/276/#p276</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Odp: $ajax->observeField i błąd form is not defined]]></title>
			<link rel="alternate" href="http://forum.cakephp.org.pl/post/275/#p275"/>
			<content type="html"><![CDATA[<p>Na początek wystarczy, żeby ten kod działał pod ff.</p><p>Rzeczywiście, nie doczytałem dokumentacji odnośnie tego, że w observeField trzeba użyć id. Zamieniłem odpowidenie pola, tak że nazwy id są już odpowiednie, Błąd nadal występuje. </p><div class="codebox"><pre><code>Form is not defined
new Form.Element.Observer(&#039;ChapterCourseId&#039;, 1, function(element, value) {new Ajax.Updater(&#039;QuestionChapterId&#039;,&#039;/questions/update_select&#039;, {asynchronous:true, evalScripts:true, parameters:Form.Element.serialize(&#039;ChapterCourseId&#039;), requestHeaders:[&#039;X-Update&#039;, &#039;QuestionChapterId&#039;]})})
40//]]&gt;</code></pre></div><p>Tak się zastaawiam, czy do wykonania tego potrzebuję prototype + scriptaculous? Czy samo prototype wystarczy?</p>]]></content>
			<author>
				<name><![CDATA[zoltan]]></name>
				<uri>http://forum.cakephp.org.pl/user/166/</uri>
			</author>
			<updated>2009-04-23T07:24:40Z</updated>
			<id>http://forum.cakephp.org.pl/post/275/#p275</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Odp: $ajax->observeField i błąd form is not defined]]></title>
			<link rel="alternate" href="http://forum.cakephp.org.pl/post/273/#p273"/>
			<content type="html"><![CDATA[<p>1.&nbsp; &quot;update&quot; =&gt; powinien wskazywac na id elementu w ktory ma byc zaladowana odpowiedz ajaxa , w 99% przyadkow jest to div, a nie input, byc moze to powoduje blad (pozatym, update elementow innych niz DIV niekoniecznie musi dzialac pod przeladarkami innymi niz&nbsp; FF).</p><p>2.&nbsp; Zamiast &#039;Chapter.course_id&#039; wstaw id pola ktore obserwujesz, a nie Model.pole</p><br /><p><a href="http://api.cakephp.org/class/ajax-helper#method-AjaxHelperobserveField">http://api.cakephp.org/class/ajax-helpe … serveField</a></p>]]></content>
			<author>
				<name><![CDATA[robal77]]></name>
				<uri>http://forum.cakephp.org.pl/user/143/</uri>
			</author>
			<updated>2009-04-22T21:45:21Z</updated>
			<id>http://forum.cakephp.org.pl/post/273/#p273</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[$ajax->observeField i błąd form is not defined]]></title>
			<link rel="alternate" href="http://forum.cakephp.org.pl/post/272/#p272"/>
			<content type="html"><![CDATA[<p>Witam. Zaczynam przygodę z cake i trafiłem na rzecz z którą nie mogę sobie poradzić. </p><p>Tworzę formularz (w widoku):<br /></p><div class="codebox"><pre><code>&lt;?php echo $form-&gt;create(&#039;Question&#039;);?&gt;</code></pre></div><p>Umieszczam w nim dwa pola, które mają być od siebie zależne (tzn. pole chapter_id od course_id).</p><div class="codebox"><pre><code>echo $form-&gt;input(&#039;Chapter.course_id&#039;);
echo $form-&gt;input(&#039;Question.chapter_id&#039;);
echo $ajax-&gt;observeField(&#039;Chapter.course_id&#039;, array(&#039;url&#039; =&gt; &#039;/questions/update_select&#039;,&#039;update&#039; =&gt; &#039;Question.chapter_id&#039;));</code></pre></div><p>W efekcie firebug rzuca mi takim błędem:<br /></p><div class="codebox"><pre><code>Form is not defined
add()()
new Form.Element.EventObserver(&#039;course_id&#039;, function(element, value) {new Ajax.Updater(&#039;Question.chapter_id&#039;,&#039;/questions/update_select&#039;, {asynchronous:true, evalScripts:true, parameters:Form.Element.serialize(&#039;course_id&#039;), requestHeaders:[&#039;X-Update&#039;, &#039;Question.chapter_id&#039;]})})
40//]]&gt;</code></pre></div><p>Ktoś ma pomysł o co chodzi?</p>]]></content>
			<author>
				<name><![CDATA[zoltan]]></name>
				<uri>http://forum.cakephp.org.pl/user/166/</uri>
			</author>
			<updated>2009-04-22T21:18:52Z</updated>
			<id>http://forum.cakephp.org.pl/post/272/#p272</id>
		</entry>
</feed>

