Results 1 to 5 of 5

Thread: put a dropdown field as obligatory

  1. #1
    garciasanchezdaniel's Avatar
    garciasanchezdaniel is offline Sugar Community Member
    Join Date
    Aug 2011
    Location
    Spain
    Posts
    403

    Question put a dropdown field as obligatory

    Hello everybody, I have a little issue.
    I have a field type dropdown with 5 values - one of these 5 values is value blank, that I create from studio adding to the dropdown value blank -
    And now, when I create a new record, I need this field as obligatory, so I edited editviewdefs.php adding to the field:
    PHP Code:
    'displayParams' => 
                array (
                  
    'required' => true,
                ), 
    Now, appear the *, so this field is now obligatory. I tested to save a record without choose a value of this dropdown field, but the record saved correctly, because value blank is attended as a normal value!!!! But I don't want this, I'd like attend value blank that don't permit save a record!!
    Any suggestions?
    Thanks
    Daniel

  2. #2
    collinlee is offline Sugar Team Member
    Join Date
    Sep 2006
    Posts
    187

    Default Re: put a dropdown field as obligatory

    Hi,

    I'm not sure which version you're using, but I believe in the 6.x versions, you can just check the required checkbox in the studio editor for the field and this should make the dropdown field required (of course you should ensure you have a blank entry shown as the first option, but seems like this is already the case with your dropdown).

  3. #3
    garciasanchezdaniel's Avatar
    garciasanchezdaniel is offline Sugar Community Member
    Join Date
    Aug 2011
    Location
    Spain
    Posts
    403

    Default Re: put a dropdown field as obligatory

    Quote Originally Posted by collinlee View Post
    Hi,

    I'm not sure which version you're using, but I believe in the 6.x versions, you can just check the required checkbox in the studio editor for the field and this should make the dropdown field required (of course you should ensure you have a blank entry shown as the first option, but seems like this is already the case with your dropdown).
    Hello collinlee, thanks for your reply.
    I'm in Versión 5.2.0c (Build 5505)
    I will test you tell me I hope that checking the field as required (from studio) solves my problem

  4. #4
    rafael.q.g@hotmail.com's Avatar
    rafael.q.g@hotmail.com is offline Sugar Community Member
    Join Date
    Jun 2011
    Location
    Florianópolis - Brazil
    Posts
    782

    Default Re: put a dropdown field as obligatory

    Empty values ("") are treated as not filled option and the dropdown field has to be validated.
    Try to find the dropdown list on your language files and verify if what you have is really a empty option or if it is just blank (with some spaces included).
    Rafael Queiroz Gonçalves
    Advanced OMG UML Certified Professional
    Sun Certified Enterprise Architect for the Java Platform
    Sun Certified Programmer for the Java 2 Platform
    IBM Certified Advanced Application Developer - Lotus Notes and Domino
    IBM Certified Application Developer - IBM WebSphere Portlet Factory
    Computer Science Mastering / UFSC - PPGCC

  5. #5
    garciasanchezdaniel's Avatar
    garciasanchezdaniel is offline Sugar Community Member
    Join Date
    Aug 2011
    Location
    Spain
    Posts
    403

    Default Re: put a dropdown field as obligatory

    I solved it. What I did was go to studio to mark the field as required, and make a quick repair and rebuild...and now when I try to create a new record, I can not, I have to choose a value of the dropdown Thanks!!!

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. Replies: 3
    Last Post: 2009-11-18, 11:59 PM
  3. Replies: 4
    Last Post: 2009-02-23, 12:45 PM
  4. add a dropdown to a field
    By dauti in forum Help
    Replies: 1
    Last Post: 2008-01-21, 08:57 PM
  5. Will Pay to add a Field and DropDown
    By arjang in forum Help
    Replies: 3
    Last Post: 2006-11-24, 07:44 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
  •