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

Dominique Faure dominique.faure at gmail.com
Wed Dec 13 09:01:17 CST 2006


On 12/13/06, Hans <design5 at softflow.co.uk> wrote:
> Wednesday, December 13, 2006, 8:13:27 AM, Dominique wrote:
>
> > As you both:
> > * introduced some javascript code,
> > * embed the submit button,
> > could you also add a dash of javascript to hide this last submit
> > button (which is only required for javascript-disabled browser)?
>
> We may run into the problem, that a jumpbox markup inserted into a
> SideBar may not be able to load javascript into the page head (this is
> a general problem as I remember). So a $HTMLHeaderFmt[] insert can't
> be done from within the markup function, which means it must be done
> from without. Maybe not a big deal, just a  little niggle I get from
> time to time.
>
[...]
>
> If you know of a better way for a general javascript enable-test
> please let me know!
>

AFAIK, only javascript-aware browser would interpret:

<script type='text/javascript'><!--
...
//--></script>

markup, and others would skip that code gracefully. So, I usually try
to generate javascript neutral pages which I improve with code
responsible to hide superfluous elements:

<form name='myform' ...>
...
<input id='myform_submit' class='inputbutton' type='submit' value='Go' />
<script type='text/javascript'><!--
document.getElementById('myform_submit').style.display = 'none';
//--></script>
</form>

I was in fact suggesting to re-use the same kind of trick I already
plugged into Cookbook.OptionMenu ;)

Dom



More information about the pmwiki-devel mailing list