Results 1 to 2 of 2

Thread: update text box after losing focus

  1. #1
    bkranson is offline Junior Member
    Join Date
    Dec 2005
    Location
    St. Louis
    Posts
    2

    Default update text box after losing focus

    I would like to use the onblur javascript feature when a user leaves a text box in the edit view of sugarcrm5.0.0b

    As a test I added:
    Code:
    'displayParams' => array ('javascript'=>'{literal}onchange="alert(this.value);"{/literal}'),
    to the <Sugar Install>/modules/<module>/metadata/editviewdefs.php
    however the javascript never makes it to the code as I view it through the IE viewsource
    I also changed the tabindex to confirm the code is not getting hung up in a cache file.

    So to sum up I can confirm some of the parameters are making it to the final output, but the onblur is not.

    Any help?

  2. #2
    dpatech is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    NC
    Posts
    287

    Default Re: update text box after losing focus

    Unfortunately the standard text field for Sugar does not look for a "javascript" displayParam. You can see this by looking at the include/SugarFields/Fields/Base/EditView.tpl file which is the smarty template used to output the HTML for a text field. You have a couple of options depending on what you are trying to do.

    1. Edit the EditView.tpl to look for and include your "javascript" displayParam.
    2. Create your own SugarField object and then set the "type" parameter to your new field type in the appropriate editviewsdefs.php entries.
    3. Override the EditView for that particular module and include a snippet of javascript code that walks the form fields and add the onblur function to the fields after they have already been output.

    Hope this helps. This is much easier in 5.0 than it was in the older versions.
    - Sugar Team
    dpa Technology LLC
    e-mail: dpaDeveloper@dpatechnology.com
    web: http://www.dpatechnology.com

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Urgent help needed...Labels won't update text
    By amqazi in forum Developer Help
    Replies: 8
    Last Post: 2008-10-08, 12:07 PM
  2. Mass Update for Text Fields or an Alternative
    By jennifleac in forum Help
    Replies: 0
    Last Post: 2007-12-17, 10:15 PM
  3. Replies: 1
    Last Post: 2007-05-28, 05:15 AM
  4. How can I create a new text box?
    By hectorimet in forum Help
    Replies: 2
    Last Post: 2006-10-26, 01:26 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
  •