Jump to content

pick list


alopama

Recommended Posts

Hi,

i am very new to PEAR PHP. And suddenly got work on it. i dont have much information on how PEAR PHP works or its coding but i have given a task to complete this. Can anyone please help me on this. i will be greatful

i have already done inserting single entry but not able to see the selected entry when i click on existing banner.

 

Please help me out. 

Link to comment
Share on other sites

hi,

this is the code which i have written in banner-edit.php file for picklist( i.e two dropdown box with add and remove button)

$renderer =& $form->defaultRenderer();
        $renderer->setElementTemplate($withoutLabel,'send');


    if (OA_Permission::isAccount(OA_ACCOUNT_ADMIN) || OA_Permission::isAccount(OA_ACCOUNT_MANAGER)) {
        $form->addElement('header', 'header_additional', $GLOBALS['strAccesspoint']);
        $dropdown = array();
        $dropdown[0] =& HTML_QuickForm::createElement('select','accesspoint',null,'');
        $dropdown[0]->setSize(10);
        $doAccesspoint = OA_Dal::factoryDAL('accesspoint');
        $accesspointList = $doAccesspoint->getAccesspointList();
        foreach ($accesspointList as $accesspoint){
                $dropdown[0]->addOption($accesspoint['ap_name_mac_id']  , $accesspoint['accesspoint_id']  , null);
       }
        $dropdown[1] =&  HTML_QuickForm::createElement('button',null,$GLOBALS['strAdd'],array('id' => 'add-accesspoint','name'=>'add-button'));
        $dropdown[2] =& HTML_QuickForm::createElement('button',null,$GLOBALS['strRemove'],array('id' => 'remove-accesspoint'),' ');
        $dropdown[3] =& HTML_QuickForm::createElement('select','accesspoint_id',null,'');

        $dropdown[3]->setSize(10);
        $form->addGroup($dropdown, 'dropdown',$GLOBALS['strAccesspoint'], ' ');
 

And this is the another  part of code  which i have written in banner-edit.html file

$(document).ready(function(){

   $('#add-accesspoint').click(function() {
  return !$('#accesspoint option:selected').remove().appendTo('#accesspoint_id');

   });
   $('#remove-accesspoint').click(function() {
    return !$('#accesspoint_id option:selected').remove().appendTo('#accesspoint');

   });

});
 

using the above code

i m selecting the value from dropdown[0] and adding it to dropdown[3].

i m able to insert the data of dropdown[3] while submitting the new banner in banner table .But while editing the existing banner i m not able to fetch the dropdown[3] value from the banner table.

Help me out at editing part.

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...