QFC - Javascript Button click()
| From: | Daniel Kopp | Date: | Wed, 19 Nov 2003 23:54:42 +0000 |
| Subject: | QFC - Javascript Button click() | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-9038@lists.php.net to get a copy of this message | ||
Hi!
hunting for good code I finally found out how a QFC-generated Button can be
clicked by Javascript without using the QFC generated code from
getButtonName.
Javascript provides the function getElementByID which allows to get an
Element not by it's name but by an ID which can be set via the
Elementparameters.
So in addElement it is:
$this->addElement('submit',$this->getButtonName('actionname'),'Button',array
('id'=>'actionname'));
And in Javascript you can use (this example hits the Button from within
another frame):
top.framename.document.getElementById('actionname').click();
Might be helpful to others.
Maybe someone can give me a solution how to use a certain form from a
controller in a certain frame directly without using the auto generated
names. I mean - directly jump in the right form in the right frame.
Regards
Daniel