Re: editing elements of an HTML_QuickForm form with javascript
| From: | Justin Patrin | Date: | Wed, 19 Jan 2005 18:14:22 +0000 |
| Subject: | Re: editing elements of an HTML_QuickForm form with javascript | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-17021@lists.php.net to get a copy of this message | ||
On Wed, 19 Jan 2005 11:34:56 +1100, Charlie Ward <charliew@caa.org.au> wrote:
> Hi there,
>
> I have a page (page A) that comprises a large form which is generated by
> HTML_QuickForm. On the form is a hyperlink which opens another page
> (page B). On page B there is a javascript function that modifies two
> elements of the form on page A.
>
> This script works fine (and has been in production for over 12 months)
> so long as I use HTML_QuickForm version 3.2.1.
>
> Using a more recent version of HTML_QuickForm (in my testing I used
> HTML_QuickForm 3.2.4.pl1) the javascript fails and the element values
> remain unchanged.
Have you tried looing at the HTML to see what's different between the two?
Have you tried using Venkman, the JS debugger in Firefox? (BTW,
Firefox 1.0 is out, you may want to upgrade.)
>
> ************JAVASCRIPT CODE*********************
>
> <script>
>
> function transfer(){
>
> var target;
>
> target=opener.document.forms["myform"].elements["partner_id1"];
>
> target.value=10; // ERROR HERE error message: target has no
> properties
>
> target=opener.document.forms["myform"].elements["partner1"];
>
> target.value="blah blah blah";
>
> }
>
> </script>
>
> **********JAVACSCRIPT CODE*********************
>
> The behaviour is the same on Internet Explorer 6.0 and Mozilla Firefox
> Preview Release Version 1.0. I'm not sure what the problem is and would
> very much appreciate any pointers.
>
--
Justin Patrin