0
votes

I am new to fend framework. I have a input box in html with on blur property which call a ajax function code is given below:

input name="companyCode" type="text" id="companyCode"  style="width:220px"                              
onblur="getOrganizationode(this.value);"

and a ajax script tags.

Basically i want my input box in Zend form with onblur function call in Add element function like this

addElement(   'text',    'companyCode'     ,    array(          
            'required'   =>     true,
            'filters'    => array('StringTrim'),
            'style'    => array('width:220px'),

so please help me

1

1 Answers

1
votes

You can just add the call to the attributes:

addElement('text', 'companyCode', array(    
    'required'   =>  true,
    'filters' => array('StringTrim'),
    'style' => array('width:220px'),
    'onBlur' => 'getOrganizationode(this.value);'
);