Pages

Showing posts with label Element. Show all posts
Showing posts with label Element. Show all posts

Saturday, April 26, 2014

Zend-Option Group in Zend_Form_Element_Multiselect

 $techDoc = new Zend_Form_Element_Multiselect(‘technical_doc’);  
 $techDoc->setLabel(‘Technical Documents’)  
 ->setMultiOptions(array(“Option Group 1″ => array(“option1″,”option2″,”option3″),  
 “Option Group 2″=>array(“option1″,”option2″,”option3″)));  

Sunday, May 12, 2013

Zend-Adding/Appending an element in a control in block

$form->submit->setDecorators(

 array(
             'ViewHelper',
              array(
                   array('data'=>'Html Tag' ),
                   array('placement'=>Zend_Form_Decorator_Abstract::PREPEND),
                    'tag'=>'span',
                    'class'=>'wp_submit'
                      ),
               array(
                    array(array('data'=>'Html Tag')),
                    array('tag'=>'span','class'=>'newspan')
                      )
        )

)

Zend-Escaping a Label of Element in a Form/Block

Zend-For Escaping a label in a block use

$form->submit->setAttributes("escape",false);

$form->submit->setLabel('Login');

Sunday, October 21, 2012

Use the javascript element for jquery functions

I was working on one of the functions and had pass an js element to it and wanted to perform jquery functions which require an id in format $("#id")

Here is how to use jquery operations on an element received in js format


//ele is an checkbox element
function enabletext(ele)
{
    if(ele.checked==true)
    {
        var myid=ele.id;
        jQuery(eval("'#" + myid + "'")).parent().siblings("#qtyid").show();
    }
}

Tuesday, October 2, 2012

document.getElementByid(id)=>shortcut

Use eval(id)
for example

eval("myelement")

returns an element with id "myelement"

Wednesday, August 10, 2011

Element.dispatchEvent(event) is not a function

Occurs when we use jquery and prototype framework at the same time.These 2 frameworks conflict
use the following code

$$=jquery.noConflict()

and then in each jquery code use $$ instead of $