Re: PHP quickform with Javascript
| From: | zia mohaddes | Date: | Sat, 13 Mar 2010 01:04:28 +0000 |
| Subject: | Re: PHP quickform with Javascript | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-30407@lists.php.net to get a copy of this message | ||
Hey Mark,
Thank you so much for the answer! I will use this to build more complicated
functions. Hopefully it'll work!
regards,
daniel
On Fri, Mar 12, 2010 at 6:57 PM, Mark Steudel <msteudel@gmail.com> wrote:
> 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
>