Results 1 to 4 of 4

Thread: Dropdown validation on blank value

  1. #1
    thancock is offline Sugar Community Member
    Join Date
    May 2008
    Posts
    11

    Default Dropdown validation on blank value - Fix needed please

    I have created drop downs with various entries having the value string include the word 'blank' and the display string being empty or containing some descriptive text

    'blank' => '',
    ....
    'blank2' => 'A HEADING',
    ....
    etc


    The various blank entries are there simply for separators and or headings to make the list easier to read for the user

    Can someone suggest an upgrade safe way of validating drop downs so that anything that has 'blank' in the value string will not validate as filled on a Save?

    Thanks
    Last edited by thancock; 2008-09-02 at 08:33 AM.

  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: Dropdown validation on blank value

    Hi thancock

    You can do the following:

    1. Modify the Save button on EditView (create a customCode to redefine it) and add a javascript function call before the "return check_form('EditView');"
    2. This javascript function should validate the dropdown value and call the function addToValidate() to force an empty data into dropdown field.

    Let me know if you need to know how to do this.

    Cheers
    André Lopes
    DevToolKit / Project of the Month - June 2009
    Lampada Global Services- Open Source Solutions
    Avenida Ipiranga, 318
    Bloco B - CJ 1602
    São Paulo, SP 01046-010
    Brazil
    Office: +55 11 3237-3110
    Mobile: +55 11 7636-5859
    e-mail: andre@lampadaglobal.com

    Lampada Global delivers offshore software development and support services to customers around the world.
    Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.

    I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.

  3. #3
    thancock is offline Sugar Community Member
    Join Date
    May 2008
    Posts
    11

    Default Re: Dropdown validation on blank value

    Hi there,

    I have had a look at the suggestion but can't figure it out and would like some more details please.

    It seems like your suggested mod will need to be done for each save button on each form? I would have liked to mod the field validation routine instead so that it works for all modules on every dropdown throughout Sugar - is this possible?

    Thank you very much for your help

    Cheers
    Tony

  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: Dropdown validation on blank value

    Hi Tony

    It is not upgrade safe once you would need to modify the function "check_form".

    Cheers
    André Lopes
    DevToolKit / Project of the Month - June 2009
    Lampada Global Services- Open Source Solutions
    Avenida Ipiranga, 318
    Bloco B - CJ 1602
    São Paulo, SP 01046-010
    Brazil
    Office: +55 11 3237-3110
    Mobile: +55 11 7636-5859
    e-mail: andre@lampadaglobal.com

    Lampada Global delivers offshore software development and support services to customers around the world.
    Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.

    I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.

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. Replies: 14
    Last Post: 2007-05-29, 11:09 PM
  3. Replies: 2
    Last Post: 2007-02-03, 12:05 AM
  4. Dropdown List Editor - Blank Items Removed
    By PrimalBlue in forum Help
    Replies: 2
    Last Post: 2005-05-08, 10:46 PM
  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
  •