Re: PHP quickform with Javascript
| From: | Mark Steudel | Date: | Fri, 12 Mar 2010 23:58:19 +0000 |
| Subject: | Re: PHP quickform with Javascript | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-30406@lists.php.net to get a copy of this message | ||
And to clarify this part:
$("#test").click( function() {
alert( 'i was clicked');
});
Is jquery, not quickform.
MS
2010/3/12 Mark Steudel <msteudel@gmail.com>:
> Short answer is yes.
>
> There are a couple of ways you could do this:
>
> 1. Add event directly to element
>
> e.g. <input type="text" onclick="dosomething();" name="test"
> id="test" />
>
> could be done in QuickForm like
>
> $form->addElement( 'text', 'test', 'My Label', array(
> 'onclick' => 'dosomething();', 'id' => 'test' ) );
>
> 2. Use a framework like jquery to add events too your form elements
>
> So to do the above example you'd probably do something like
>
> $form->addElement( 'text', 'test', 'My Label', array(
> 'id' => 'test' ) );
>
> $("#test").click( function() {
> alert( 'i was clicked');
> });
>
> Hope that gets you going.
>
> Mark
> On Fri, Mar 12, 2010 at 1:42 PM, zia mohaddes <zia.simab@gmail.com> wrote:
>> Hello everyone,
>>
>> I am currently using php quickform to create form elements( buttons, text,
>> etc...) . However I intend to combine these elements with javascript but I
>> am not sure if there php quickform provides the ability of incorporating
>> javascript into the form.
>>
>> I would highly appreciate if anyone can give me some insights as to how I
>> could proceed!
>>
>> Thank you kindly for the help in advance!
>>
>> regards,
>>
>> daniel
>>
>
>
>
> --
>
> -----------------------------------------
> Mark Steudel
> P: 206.375.7244
> msteudel@gmail.com
>
> . : Work : .
> http://www.mindfulinteractive.com
>
> . : Play : .
> http://www.steudel.org/blog
>
>
>
>
--
-----------------------------------------
Mark Steudel
P: 206.375.7244
msteudel@gmail.com
. : Work : .
http://www.mindfulinteractive.com
. : Play : .
http://www.steudel.org/blog