cvs: peardoc /en/package/html html-quickform.xml /en/package/html/html-quickform intro-faq.xml /en/package/html/html-quickform-controller faq.xml

From: Date: Thu, 30 Sep 2004 10:21:01 +0000
Subject: cvs: peardoc /en/package/html html-quickform.xml /en/package/html/html-quickform intro-faq.xml /en/package/html/html-quickform-controller faq.xml
Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-4909@lists.php.net to get a copy of this message
avb Thu Sep 30 06:21:01 2004 EDT Added files: /peardoc/en/package/html/html-quickform intro-faq.xml Modified files: /peardoc/en/package/html html-quickform.xml /peardoc/en/package/html/html-quickform-controller faq.xml Log: Added FAQ for QuickForm, updated FAQ for QuickForm_Controller

http://cvs.php.net/diff.php/peardoc/en/package/html/html-quickform.xml?r1=1.19&r2=1.20&ty=u Index: peardoc/en/package/html/html-quickform.xml diff -u peardoc/en/package/html/html-quickform.xml:1.19 peardoc/en/package/html/html-quickform.xml:1.20 --- peardoc/en/package/html/html-quickform.xml:1.19 Thu Nov 6 15:36:14 2003 +++ peardoc/en/package/html/html-quickform.xml Thu Sep 30 06:21:01 2004 @@ -1,4 +1,4 @@ -<!-- $Revision: 1.19 $ --> +<!-- $Revision: 1.20 $ --> <sect1 id="package.html.html-quickform"> <title>HTML_QuickForm</title> <para> @@ -20,6 +20,7 @@ QuickForm provides the possibility to create your own elements as long as you comply with the common API. </para> &package.html.html-quickform.tutorial; +&package.html.html-quickform.intro-faq; &package.html.html-quickform.intro-elements; &package.html.html-quickform.intro-migration32; </sect2> http://cvs.php.net/diff.php/peardoc/en/package/html/html-quickform-controller/faq.xml?r1=1.3&r2=1.4&ty=u Index: peardoc/en/package/html/html-quickform-controller/faq.xml diff -u peardoc/en/package/html/html-quickform-controller/faq.xml:1.3 peardoc/en/package/html/html-quickform-controller/faq.xml:1.4 --- peardoc/en/package/html/html-quickform-controller/faq.xml:1.3 Fri Dec 12 10:55:58 2003 +++ peardoc/en/package/html/html-quickform-controller/faq.xml Thu Sep 30 06:21:01 2004 @@ -1,4 +1,4 @@ -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <refentry id="package.html.html-quickform-controller.faq"> <refnamediv> <refname>FAQ</refname> @@ -122,6 +122,15 @@ </refsect1> + <refsect1 id="package.html.html-quickform-controller.faq.clear-container"> + <title>How do I reset the form?</title> + <para> + Controller keeps the form data and validation status in session in so-called container, accessible via + <link linkend="package.html.html-quickform-controller.html-quickform-controller.container"><function>container</function></link> + method. To reset the form you need to clear this container, which is achieved by passing &true; to + <function>container</function>. + </para> + </refsect1> <refsect1 id="package.html.html-quickform-controller.faq.additional-data"> <title>How to pass additional data between pages of the form?</title> @@ -213,6 +222,22 @@ The working example is available in <filename>statemachine.php</filename> file. </para> </refsect1> + + <refsect1 id="package.html.html-quickform-controller.faq.back-validation"> + <title>I use client-side validation. How do I switch it off for <literal>&apos;Back&apos;</literal> button?</title> + <para> + Client-side validation is called by form&apos;s <varname>onSubmit</varname> handler, if you remove + the handler, the validation will not run. Therefore you need to remove it if user clicks on + <literal>&apos;Back&apos;</literal> button. This can be achieved f.e. by adding the following as + the button&apos;s <varname>onClick</varname> handler: +<programlisting role="javascript"> +<![CDATA[ +this.form.onsubmit = null; return true; +]]> +</programlisting> + </para> + </refsect1> + </refentry> http://cvs.php.net/co.php/peardoc/en/package/html/html-quickform/intro-faq.xml?r=1.1&p=1 Index: peardoc/en/package/html/html-quickform/intro-faq.xml +++ peardoc/en/package/html/html-quickform/intro-faq.xml <!-- $Revision: 1.1 $ --> <refentry id="package.html.html-quickform.intro-faq"> <refnamediv> <refname>QuickHelp</refname> <refpurpose>Answers to most Frequently Asked Questions</refpurpose> </refnamediv> <refsect1 id="package.html.html-quickform.intro-faq.desc"> &title.desc; <para> This document is based on questions asked on <ulink url="mailto:&email.pear.general;">PEAR general mailing list</ulink>. You are encouraged to search the list archives to find more verbose answers and examples. </para> </refsect1> <refsect1 id="package.html.html-quickform.intro-faq.content"> <title>HTML_QuickForm FAQ</title> <qandaset> <qandaentry> <question> <para> The forms I generate with HTML_QuickForm cannot be submitted. When I look at the page&apos;s HTML source, I see something like <literal>&lt;formArray&gt;</literal>. </para> </question> <answer> <para> Recent versions of HTML_QuickForm package require HTML_Common package version 1.2.1 (CVS revision 1.8 in <filename>HTML/Common.php</filename>) to work properly. If (and only if) an older version of HTML_Common is loaded, these symptoms occur. </para> <para> Please note that <screen> <userinput> &dollar; pear list </userinput> </screen> command may tell you that you <emphasis>have</emphasis> HTML_Common 1.2.1 installed. In this case you also have an older version of HTML_Common somewhere and are including it instead of the proper one. Check your <varname>include_path</varname> setting in <filename>php.ini</filename> and/or use PHP&apos;s <ulink url="&url.php.lookup;get_included_files"><function>get_included_files</function></ulink> function to find out which file you are <emphasis>really</emphasis> including. </para> </answer> </qandaentry> <qandaentry> <question> <para> When I pass some GET parameters to the script containing a form, QuickForm thinks that the form was already submitted, displaying validation errors. </para> </question> <answer> <para> <link linkend="package.html.html-quickform.html-quickform.html-quickform">Constructor</link> of <classname>HTML_QuickForm</classname> accepts a <parameter>$trackSubmit</parameter> parameter. Setting this to &true; will make QuickForm check whether the form was actually submitted. This also helps if you have several forms defined on one page. </para> </answer> </qandaentry> <qandaentry> <question> <para> How do I set default/constant values for <literal>&apos;date&apos;</literal> element? </para> </question> <answer> <para> <link linkend="package.html.html-quickform.html-quickform-date">Date</link> element is essentially a <link linkend="package.html.html-quickform.html-quickform-group">group</link> of selects, you define the structure of this group in the <literal>&apos;format&apos;</literal> option when <link linkend="package.html.html-quickform.html-quickform-date.html-quickform-date">creating the element</link>: <programlisting role="php"> <![CDATA[ $form->addElement('date', 'foo', 'The date:', array('format' => 'Y m d')); ]]> </programlisting> Thus you pass the defaults as an array, just like you do with any other group: <programlisting role="php"> <![CDATA[ $form->setDefaults(array( 'foo' => array('Y' => 2004, 'm' => 9, 'd' => 29) )); ]]> </programlisting> </para> <para> To ease using it with database-backed applications, date element also accepts Unix timestamps (generated by <ulink url="&url.php.lookup;mktime"><function>mktime</function></ulink>) and strings. The strings are processed by <ulink url="&url.php.lookup;strtotime"><function>strtotime</function></ulink> functions, so consider its limitations. </para> </answer> </qandaentry> <qandaentry> <question> <para> I receive weird <literal>&quot;Call to a member function on a non-object&quot;</literal> or <literal>&quot;Undefined function&quot;</literal> errors, especially when dealing with groups. </para> </question> <answer> <para> These errors tend to appear when you have something which is not a <classname>HTML_QuickForm_element</classname> in the <parameter>$elements</parameter> array passed to <link linkend="package.html.html-quickform.html-quickform.addgroup"><function>addGroup</function></link>. This &quot;something&quot; is usually either a <classname>PEAR_Error</classname> instance (check for these or setup a handler) or, if <varname>register_globals</varname> is switched on in <filename>php.ini</filename>, some submitted values (clear the array before adding elements to it). </para> </answer> </qandaentry> </qandaset> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-executeMultiple-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->
« previous php.pear.doc (#4909) next »