[pmwiki-devel] Select & Option Dropdown-list Markup

Dominique Faure dominique.faure at gmail.com
Tue Dec 12 02:52:15 CST 2006


On 12/11/06, Patrick R. Michaud <pmichaud at pobox.com> wrote:
> On Mon, Dec 11, 2006 at 01:55:38PM -0600, Patrick R. Michaud wrote:
> > On Mon, Dec 11, 2006 at 07:27:58PM +0000, Hans wrote:
> > > do you consider it as a more complex form if it uses javascript as an
> > > option, as I proposed for the <select> box markup
> > >
> > > onchange='window.location.href=this.options[this.selectedIndex].value'
> > >
> > > to have an option for instant jumping to a url page location?
> > to be generated from a pagelist by using:
> >
> >     [[#jumpbox]]
> >     (:if equal {<$FullName}:)(:input form {$ScriptUrl}:)(:if:)
> >     (:input jumpbox value={=$PageUrl} label="{=$Title}":)
> >     (:if equal {>$FullName}:)
> >     (:input submit post "Go to Page":)
> >     (:input end:)
> >     [[#jumpboxend]]
> > ...
>
> Actually, after thinking about it a bit further, it might be
> better to define
>
>   $InputTags['jumpform']['name'] = 'n';
>   $InputTags['jumpform'][':html'] =
>     "<form action='{$PageUrl}' method='get'>
>      <select \$InputFormArgs
>        onchange='window.location.href=this.options[this.selectedIndex].value'>
>      \$InputSelectOptions</select>
>      <input type='submit' value='$[Go to Page]' /></form>";
>
> In this case, the pagelist needed to generate a jumpform is just
>
>     [[#jumpform]]
>     (:input jumpform value="{=$PageUrl}" label="{=$Title}":)
>     [[#jumpformend]]
>
> and we don't have to worry about creating any form or submit elements
> because "(:input jumpform ...)" already takes care of that for us.
>

One more time, I'm very pleased to have to obsolete weird recipes... ;)

Dom



More information about the pmwiki-devel mailing list