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

kirpi at kirpi.it kirpi at kirpi.it
Mon Jul 23 11:49:49 CDT 2007


> I did not understand why you need id and name in the form tag...

Nor did I, actually.
:-)
Really, Hans, I hardly understand all these things.
Yesterday evening I made my homework and here is my buggy explanation.

As far as I can tell, it seems that there is something called DOM
which helps linking javascript code and html.
My working example at http://www.kirpi.it/wiki/pmwiki.php?n=Main.Calendarietto
has this code

(: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:)

As far as I could learn on the internet, that
document.forms[0].data_inizio
strange command references the first form (the one I called "pippo")
in the page and put the selected value into any field named
"data_inizio".
This way the dated picked by the calendar javascript is easily put as
a value into the proper input field (there could be more than one).

This is the way I understood it, at least.
Does it make sense to you?

Now the next step.
As I try and switch the plain (:input:) markup with the (:newpagebox:)
markup, in order to let then create a new page with the value input
into the field, it happens that the document.forms[0].data_inizio has
no way to find the "data_inizio" part, as it is not defined.

For this very reason I thought it would be useful to enable name and
id, just the way they are enabled in the plain input markup.

Could I express it all?
Did I misunderstand anything?
Am I too far from the right way?

Luigi



More information about the pmwiki-users mailing list