Results 1 to 5 of 5

Thread: Another DropDown Question

  1. #1
    cagatay is offline Sugar Community Member
    Join Date
    Mar 2008
    Location
    Turkiye
    Posts
    72

    Default Another DropDown Question

    Hi All

    I wanna make that; After selecting an item from DropDown list a new box should open near it automaticly.
    (If not selectied not open)

    Is it possbile ?

    Regards
    Last edited by cagatay; 2008-03-27 at 02:27 PM.

  2. #2
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,335

    Default Re: Another DropDown Question

    Hi, cagatay

    You could do that using javascript event onchange which modify the visibility of the field.

    --
    André Lopes
    Lâmpada Global Services
    Rua Bela Cintra, 299 conjunto. 51
    São Paulo, SP 01415-000
    tel1. 55 11 3237-3110
    cel. 55 11 7636-5859
    e-mail: info@lampadacrm.com.br

  3. #3
    cagatay is offline Sugar Community Member
    Join Date
    Mar 2008
    Location
    Turkiye
    Posts
    72

    Default Re: Another DropDown Question

    Dear andopes

    I know that it is easy with JS, but how can I integrate JS with SugarCRM ?

    With which file? In which field? Line? etc...

    Has nobody try and do that?

    Sincerelly

  4. #4
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,335

    Default Re: Another DropDown Question

    Hi, cagatay.

    You will modify only the file custom/modules/YourModule/metadata/editviewdefs.php
    If it does not exist so copy from modules/YourModule/metadata/editviewdefs.php

    Inside the 'templateMeta' array insert a new entry:

    PHP Code:
    'include' => array(
        array(
    'file' => 'modules/YourModule/YourModule.js'),
    ), 
    It will include the new js to the current page.

    You must add a new entry to dropdown field:

    PHP Code:
    'displayParams'=>array('required'=>true'javascript'=>'onchange="functionToCall();"'), 
    This will define the onchage event to this field.

    You must define a custom code to the field whose visibility will be set by the dropdown.

    That is all, folks.

    --
    André Lopes
    Lâmpada Global Services
    Rua Bela Cintra, 299 conjunto. 51
    São Paulo, SP 01415-000
    tel1. 55 11 3237-3110
    cel. 55 11 7636-5859
    e-mail: info@lampadacrm.com.br

  5. #5
    DragonflyMaster is offline Sugar Community Member
    Join Date
    Dec 2007
    Location
    Rimini, Italy
    Posts
    1,421

    Default Re: Another DropDown Question

    Quote Originally Posted by cagatay
    Dear andopes

    I know that it is easy with JS, but how can I integrate JS with SugarCRM ?

    With which file? In which field? Line? etc...

    Has nobody try and do that?

    Sincerelly
    Hi,
    I wrote a small guide that explains how to add custom javascript code.
    You can find it here.
    In my guide, I show how to link 2 dropdowns, but you could easily change it to work with text fields.
    What do you think the cookie monster eats ?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 5
    Last Post: 2008-02-27, 06:48 PM
  2. Dropdown list
    By sridhar in forum Help
    Replies: 0
    Last Post: 2006-08-18, 01:54 PM
  3. Dropdown Editor question - newbie
    By frankt in forum Help
    Replies: 1
    Last Post: 2005-12-15, 05:27 PM
  4. linked dropdown menus?
    By mattb12 in forum Help
    Replies: 3
    Last Post: 2005-10-08, 07:30 AM
  5. Contact Search Form - Custom Dropdown Field
    By aram in forum General Discussion
    Replies: 2
    Last Post: 2005-05-01, 03:57 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •