logo       

QFC - Javascript Button click(): msg#00339

php.pear.general

Subject: QFC - Javascript Button click()

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

--
PEAR General Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise