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

From: Date: Fri, 03 Oct 2003 12:59:16 +0000
Subject: cvs: peardoc /en/package/html html-quickform-controller.xml /en/package/html/html-quickform-controller intro.xml
Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-1551@lists.php.net to get a copy of this message
avb Fri Oct 3 08:59:16 2003 EDT Modified files: /peardoc/en/package/html html-quickform-controller.xml /peardoc/en/package/html/html-quickform-controller intro.xml Log: Updated QF_Controller docs for 0.9.2 Index: peardoc/en/package/html/html-quickform-controller.xml diff -u peardoc/en/package/html/html-quickform-controller.xml:1.2 peardoc/en/package/html/html-quickform-controller.xml:1.3 --- peardoc/en/package/html/html-quickform-controller.xml:1.2 Fri Sep 19 11:15:07 2003 +++ peardoc/en/package/html/html-quickform-controller.xml Fri Oct 3 08:59:15 2003 @@ -94,6 +94,7 @@ &package.html.html-quickform-controller.html-quickform-page.handle; &package.html.html-quickform-controller.html-quickform-page.isformbuilt; &package.html.html-quickform-controller.html-quickform-page.loadvalues; +&package.html.html-quickform-controller.html-quickform-page.setdefaultaction; <refentry id="package.html.html-quickform-controller.html-quickform-action-summary"> Index: peardoc/en/package/html/html-quickform-controller/intro.xml diff -u peardoc/en/package/html/html-quickform-controller/intro.xml:1.1 peardoc/en/package/html/html-quickform-controller/intro.xml:1.2 --- peardoc/en/package/html/html-quickform-controller/intro.xml:1.1 Thu Sep 4 17:03:49 2003 +++ peardoc/en/package/html/html-quickform-controller/intro.xml Fri Oct 3 08:59:15 2003 @@ -1,4 +1,4 @@ -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="package.html.html-quickform-controller.intro"> <refnamediv> <refname>Introduction</refname> @@ -87,6 +87,8 @@ // Define filters and validation rules $this->applyFilter('name', 'trim'); $this->addRule('name', 'Please enter your name', 'required', null, 'client'); + + $this->setDefaultAction('submit'); } } @@ -134,7 +136,7 @@ <para> You need to subclass <link linkend="package.html.html-quickform-controller.html-quickform-page-summary"><classname>HTML_QuickForm_Page</classname></link> and override its <link linkend="package.html.html-quickform-controller.html-quickform-page.buildform"><function>buildForm</function></link> -method. Its contents are pretty self-explanatory (if you are familiar with <link linkend="package.html.html-quickform">QuickForm</link>), except for two things: +method. Its contents are pretty self-explanatory (if you are familiar with <link linkend="package.html.html-quickform">QuickForm</link>), except for a few things: <programlisting role="php"> <![CDATA[ $this->_formBuilt = true; @@ -154,6 +156,15 @@ We use <link linkend="package.html.html-quickform-controller.html-quickform-page.getbuttonname"><function>getButtonName</function></link> method to set the submit button's name and thus to trigger a <literal>'submit'</literal> action when the button is clicked. + </para> + <para> +The third thing is +<programlisting role="php"> +<![CDATA[ +$this->setDefaultAction('submit'); +]]> +</programlisting> +The user can submit the form by pressing Enter button, not by clicking on any of the form buttons. Most browsers will not consider any submit button as clicked in this case and will not send its name. <link linkend="package.html.html-quickform-controller.html-quickform-page.setdefaultaction"><function>setDefaultAction</function></link> sets the action (by adding a special hidden element to the form) that will be called in this case. </para> </refsect2>

« previous php.pear.doc (#1551) next »