Community

Forums » 3rd Party Product Discussions

Not sure why code is not working

    • 168 posts
    June 19, 2019 10:08 AM EDT

    I am trying to add text which is a link upon signup.

    The first piece of code below works, the second does not.  Any idea why not?

    This works:

    //SES Custom Work $categories = Engine_Api::_()->getDbtable('categories', 'cecustom')->getCategoriesAssoc(); if( count($categories) > 0 ) { $this->addElement('Select', 'category_id', array( 'label' => 'In which district are you eligible to vote?','description' => 'Find Your District here: http://bit.ly/2ZEe6KN', 'multiOptions' => $categories, )); } //SES Custom Work

     

    This does not:

    //SES Custom Work $categories = Engine_Api::_()->getDbtable('categories', 'cecustom')->getCategoriesAssoc(); if( count($categories) > 0 ) { $this->addElement('Select', 'category_id', array( 'label' => 'In which district are you eligible to vote?','description' => 'Find Your District <a href='http://bit.ly/2ZEe6KN'>by clicking here.</a>, 'multiOptions' => $categories, )); } //SES Custom Work

     

    • 3537 posts
    June 19, 2019 12:01 PM EDT

    Moved to third party product discussions as the code you show is for a third party custom plugin.

    • 36 posts
    June 29, 2019 2:16 PM EDT

    Cleaned up your code. The following should work:

     

    //SES Custom Work $categories = Engine_Api::_()->getDbtable('categories', 'cecustom')->getCategoriesAssoc(); if( count($categories) > 0 ) { $this->addElement('Select', 'category_id', array( 'label' => 'In which district are you eligible to vote?','description' => 'Find Your District <a href="http://bit.ly/2ZEe6KN">by clicking here.</a>', 'multiOptions' => $categories, )); } //SES Custom Work