This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use the new forum.
Home » legacy support » symfony 1.1 » $form[field]->render to add onchange events.
$form[field]->render to add onchange events. [message #61155] Wed, 17 September 2008 00:53 Go to next message
Mascot  is currently offline Mascot
Messages: 14
Registered: July 2008
Junior Member
I have a field.


$form[field]->render(array("onchange" => "this.dosomething('variable');"));


However, this converts quotations, so that breaks the Javascript.
Is there anyway to precent this? Thanks Smile
Re: $form[field]->render to add onchange events. [message #69602 is a reply to message #61155 ] Sat, 10 January 2009 02:46 Go to previous messageGo to next message
josh4  is currently offline josh4
Messages: 18
Registered: September 2008
Junior Member
I couldn't get it to work that way. I think the render() method is meant to be called at the form creation per field.

see The Prototype Template Customization

Instead this worked for me
echo $form['title']->renderRow(array('onchange'=>'this.dosomething(\'variable\');'));
Re: $form[field]->render to add onchange events. [message #88756 is a reply to message #61155 ] Fri, 20 November 2009 15:26 Go to previous message
nabito  is currently offline nabito
Messages: 1
Registered: November 2009
Junior Member
both of the method doesn't work for me.

I have tried getting form variable using $sf_data['form']->getRaw() but that the \' still appears as html entity.

Anyone with the working solution?
Previous Topic:Empty module and/or action after parsing the URL
Next Topic:sfApplicationConfiguration in task
Goto Forum:
  

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software