[pmwiki-devel] Select & Option Dropdown-list Markup
Patrick R. Michaud
pmichaud at pobox.com
Mon Dec 11 13:55:38 CST 2006
On Mon, Dec 11, 2006 at 07:27:58PM +0000, Hans wrote:
> Monday, December 11, 2006, 7:20:09 PM, Patrick wrote:
>
> > More complex forms still deserve custom markup.
>
> 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?
At present, the core (:input:) markups do not allow javascript
from the markup.
However, a site administrator or recipe can of course provide
custom (:input:) markups that perform javascript validation.
For example, I might implement the "jsgoto" feature entirely
differently, by defining a new control type:
(:input jumpbox {Page1$PageUrl}:)
(:input jumpbox {Page2$PageUrl}:)
(:input jumpbox {Page3$PageUrl}:)
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]]
The local customization needed over-and-above the core forms
markup to make (:input jumpbox:) work will likely be something
as short as:
$InputTags['jumpbox'][':html'] =
"<select \$InputFormArgs
onchange='window.location.href=this.options[this.selectedIndex].value'
>\$InputSelectOptions</select>";
Markup('input-jumpbox', 'input-select',
'/\\(:input\\s+jumpbox\\s.*?:\\)/e',
"InputSelect(\$pagename, 'jumpbox', PSS('$0'))");
Once I get the forms.php update in place I'll write up a demonstration
page and/or recipe.
Pm
More information about the pmwiki-devel
mailing list