editing elements of an HTML_QuickForm form with javascript
| From: | Charlie Ward | Date: | Wed, 19 Jan 2005 00:34:56 +0000 |
| Subject: | editing elements of an HTML_QuickForm form with javascript | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-17005@lists.php.net to get a copy of this message | ||
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.
************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.
Thanks very much
Cheers
Charlie.
Oxfam Community Aid Abroad
156 George Street
Fitzroy VIC
Australia 3065
tel: +61 3 9289 9444
fax:+61 3 9419 5895
http://www.oxfam.org.au <http://www.oxfam.org.au/>