Results 1 to 4 of 4

Thread: Error alert when saving account

  1. #1
    blablaz is offline Senior Member
    Join Date
    Jan 2011
    Posts
    25

    Default Error alert when saving account

    Hello everyone,

    SugarCRM 6.1.4 PRO, Internet Explorer 8, Internet Explorer 9:

    In Accounts EditView, when i press the save button, an alert pops up mistakenly. Saying: "Are you sure you want to leave the page? Website message: You are about to leave this page without saving the changes......"

    I can workaround this problem by enabling the compatibility view, but i need to know if there is a way to actually solve it.
    It only happens with Internet Explorer.

    Bellow is the php code of the button in ../custom/modules/Accounts/metadata/editview.php

    PHP Code:
    'customCode' => '<input id="save" type="submit" value="Save" name="button" onclick="this.form.action.value=\'Save\'; return(add_checks(document.EditView) && check_form(\'EditView\'));"class="button" accesskey="S" title="Save [Alt+S]"/>&nbsp;'
    Thanks in advance.

  2. #2
    blablaz is offline Senior Member
    Join Date
    Jan 2011
    Posts
    25

    Default Re: Error alert when saving account

    Hello everyone,

    This problem seems to be due to declaring the save button as a customCode. In editview it is by default declared as follows:
    PHP Code:
    'buttons' => 
            array (
              
    => 'SAVE',
              
    => 'CANCEL',
            ), 
    But as i needed to include a javascript file to be executed onclick "Save", I changed the botton declaration to customCode.
    PHP Code:
    'buttons' => 
            array (
              
    => 
              array (
                
    'customCode' => '<input id="save" type="submit" value="Save" name="button" onclick="this.form.action.value=\'Save\'; return(add_checks(document.EditView) && check_form(\'EditView\'));"class="button" accesskey="S" title="Save [Alt+S]"/>',
              ),
              
    => 'CANCEL',
            ), 
    Now, if anyone knows a better way to call the javascript file, when saving the record, without having to change the "Save" button declaration, please let me know.

    Thanks in advance!

  3. #3
    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: Error alert when saving account

    Add the call to function check_form inside your custom javascript function.
    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.

  4. #4
    blablaz is offline Senior Member
    Join Date
    Jan 2011
    Posts
    25

    Default Re: Error alert when saving account

    Hello again,

    Well, the problem in the end was in my javascript file. I was using the trim() function and for some reason Interent Explorer 8 is complaining about it.

    I just used another way to get the same functionality as trim().

    Hope it helps!

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Account Transfer javascript alert message
    By rishavraj in forum Developer Help
    Replies: 0
    Last Post: 2010-11-12, 08:15 AM
  2. Replies: 1
    Last Post: 2010-08-17, 05:21 AM
  3. Account alert!
    By timolein in forum Help
    Replies: 5
    Last Post: 2009-06-05, 11:15 AM
  4. Replies: 1
    Last Post: 2007-03-08, 12:04 AM
  5. Replies: 5
    Last Post: 2007-02-10, 03:51 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
  •