[pmwiki-users] NewPageBox[Plus] missing id="" and name=""

Hans design5 at softflow.co.uk
Mon Jul 23 16:41:18 CDT 2007


Monday, July 23, 2007, 5:49:49 PM, kirpi at kirpi.it wrote:

> (:html:)<form name="pippo">(:htmlend:)
> (:input text name="data_inizio" value="Scegli la data di inizio
> settimana" id="holder" size="30":)
> (:html:)</form>(:htmlend:)
> (:html:)
> [<a
> href="javascript:showCalendar('2',document.forms[0].data_inizio,null,'','holder',0,30,1)">mostra
> il calendario</a>]
> (:htmlend:)

To use newpageboxplus and no (:html:) markup, you need to change the
newpageboxplus.php script in this way:
on line 68:
"    <input class='inputbox newpagetext' type='text' name='name' value='{$opt['value']}' size='{$opt['size']}'" .
replace name='name' with name='data_inizio'
or with name='{$opt['name']}' and then use name=data_inizio in the
(:newpagebox:) markup as a paremeter.
ie: (:newpagebox name=data_inizio:)
this name will be given to the text input field.
You do not need to modify the forms tag, as i suggested in my
previous reply.

DOM documents.forms[0] in the javascript will refer to the first form on the page.
This could give wrong results, as for instance a searchbox in the
header will become the first form, and not your newpagebox.
So you may need to tweak the index number (the javascript keeps the
forms in an array).
You would also need to define the javascript markup from within php,
by creating a custom markup, in order to avoid use of (:html:)
markup. Something like this perhaps, in config.php, and then use in
the page markup  (:ShowCalendarLink:)

Markup('showCalendar', '>block', '/\\(:ShowCalendarLink:\\)/',
"<a href=\"javascript:showCalendar('2',document.forms[0].data_inizio,null,'','holder',0,30,1)\">
mostra il calendario</a>");

All this is untested!

I think my own preference would be not to use newpageboxplus, because
of the modifications, but use Fox instead, with normal (:input:)
markup, as it allows more customisations straight from the markup.

  ~Hans




More information about the pmwiki-users mailing list