Results 1 to 4 of 4

Thread: Hide field unyil dropdown value

  1. #1
    Meyer is offline Sugar Community Member
    Join Date
    Oct 2006
    Location
    south africa
    Posts
    646

    Default Hide field unyil dropdown value

    Hi there

    I have a dropdown in leads. and a field called referred by. I need the referred by field greyd out or hidden untill that dropdown value is chosen?

    Any ideas?

  2. #2
    mikesolomon is offline Sugar Community Member
    Join Date
    Feb 2008
    Location
    UK
    Posts
    1,467

    Default Re: Hide field unyil dropdown value

    You can do it with javascript

    In editviewdefs you can add a onchange event to the dropdown

    Code:
     1 => 
              array (
                'name' => 'otype',
                'label' => 'LBL_OTYPE',
                 'displayParams' => 
                array (
                  'javascript' => 'onchange="other_type(this.value)"',
                ),
                'tabindex' => '11',
              ),
            ),
    You also need to call this function when you edit the record so the field is set to the correct state
    Mike Solomon
    Development Manager
    Ivy Ltd
    www.ivy.ltd.uk]www.ivy.ltd.uk

    php version 5.2.6
    MySql 5.1.59

  3. #3
    Meyer is offline Sugar Community Member
    Join Date
    Oct 2006
    Location
    south africa
    Posts
    646

    Default Re: Hide field unyil dropdown value

    Thanks a lot.

    Sorry but i am now a programmer so bare with me please.
    This is still sugar 4.5.1

    my dropdown field is type. and field that needs to be hidden is reffered_by

    1 =>
    array (
    'name' => 'reffered_by',
    'label' => 'LBL_reffered_by',
    'displayParams' =>
    array (
    'javascript' => 'onchange="type(referred)"',
    ),
    'tabindex' => '11',
    ),
    ),


    Does the above too right?
    1 =>
    array (
    'name' => 'otype',
    'label' => 'LBL_OTYPE',
    'displayParams' =>
    array (
    'javascript' => 'onchange="other_type(this.value)"',
    ),
    'tabindex' => '11',
    ),
    ),

  4. #4
    mikesolomon is offline Sugar Community Member
    Join Date
    Feb 2008
    Location
    UK
    Posts
    1,467

    Default Re: Hide field unyil dropdown value

    Quote Originally Posted by Meyer View Post
    Thanks a lot.

    Sorry but i am now a programmer so bare with me please.
    This is still sugar 4.5.1

    my dropdown field is type. and field that needs to be hidden is reffered_by

    1 =>
    array (
    'name' => 'reffered_by',
    'label' => 'LBL_reffered_by',
    'displayParams' =>
    array (
    'javascript' => 'onchange="type(referred)"',
    ),
    'tabindex' => '11',
    ),
    ),


    Does the above too right?
    1 =>
    array (
    'name' => 'otype',
    'label' => 'LBL_OTYPE',
    'displayParams' =>
    array (
    'javascript' => 'onchange="other_type(this.value)"',
    ),
    'tabindex' => '11',
    ),
    ),
    You need the javascript on the type field not the reffered_by field

    The code I am using is in 5.2 - not sure if it will work in 4.5

    I would test it by doing something like

    array (
    'name' => 'type',
    'label' => 'LBL_TYPE',
    'displayParams' =>
    array (
    'javascript' => 'onchange="alert(this.value)"',
    ),
    'tabindex' => '11',
    ),

    Then do a repair and try changing values in the dropdown - each time you change the value it should popup the field value
    Mike Solomon
    Development Manager
    Ivy Ltd
    www.ivy.ltd.uk]www.ivy.ltd.uk

    php version 5.2.6
    MySql 5.1.59

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 20
    Last Post: 2010-09-27, 09:56 AM
  2. Hide Assigned To field
    By vijay9948 in forum Developer Help
    Replies: 5
    Last Post: 2010-07-30, 08:21 PM
  3. Replies: 13
    Last Post: 2010-05-26, 05:58 AM
  4. Replies: 3
    Last Post: 2009-11-18, 11:59 PM
  5. Dynamically show/hide fields based on dropdown selection
    By moresugar in forum Developer Help
    Replies: 3
    Last Post: 2009-04-21, 09:39 PM

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
  •