Re: Accessing QF_date elements from javascript (2nd and last try :)

From: Date: Wed, 19 May 2004 14:58:43 +0000
Subject: Re: Accessing QF_date elements from javascript (2nd and last try :)
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-12612@lists.php.net to get a copy of this message
Hi! Cesare D'Amico wrote: > all three <SELECT>s in the widget get the same ID, so I cannot > access them with document.getElementById(). The names of the > <SELECT>s are "data_da[d]", "data_da[F]", "data_da[Y]" > (which are > incorrect names for JS variables) so I can't get the values by > document.forms[0].widget_name either. > > "pear info HTML_QuickForm" says that I'm using > "HTML_QuickForm-3.2". > > Any idea? Thanks for your attention :) I know that problem There are 2 possibilities: the ugly: You can go by the elementnumber in the form with Javascript: every element in a Form is numbered and somehow you can get the element you want. This is not really cool as it will crash as soon as you change anything before the used element in the form. the difficult: a date element is actually a automatically created group-element. So you can use group functions to put attributes in the different fields. You need to use IDs as QF uses the name-attribute. I tried the second, finally gave up and used the first way ... I think it would be a good idea to set these ids automatically to something like: name_d, name_y etc. Would you file a bug for this.?! regards Daniel

« previous php.pear.general (#12612) next »