Results 1 to 5 of 5

Thread: Javascript in HTML or Link field?

  1. #1
    bstonehill is offline Sugar Community Member
    Join Date
    Nov 2006
    Location
    Atlanta, GA
    Posts
    98

    Default Javascript in HTML field?

    I have a popup window I want to launch from the detail view of a record. I've tried using javascript window.open() in an html field but it keeps stripping it out. I can open a simulated popup window by just using a hyperlink with target="_new" and then resizing the window in the body onLoad(), but I still get all the toolbars and scrollbars and everything else and this only works in IE. Firefox opens it in a new tab and then resizes the whole thing.

    Thanks in advance
    Last edited by bstonehill; 2008-06-30 at 08:50 PM.

  2. #2
    bstonehill is offline Sugar Community Member
    Join Date
    Nov 2006
    Location
    Atlanta, GA
    Posts
    98

    Default Re: Javascript in HTML or Link field?

    Okay, I've figured out that javascript is filtered out by the securexss() function in utils.php. Before I modify this function to not filter out javascript, is there a way to exclude just this particular field or to hardcode it's value so it's not run through securexss()?

    Before I get blasted, I'm aware of the security risks but it's strictly accessible only on the LAN by about 20 users that I manage (none of which could even tell me what javascript is), and there will be no user editable html fields. I just need to be able to launch a popup from detail view.

  3. #3
    julian's Avatar
    julian is offline Sugar Team Member
    Join Date
    Sep 2004
    Posts
    1,639

    Default Re: Javascript in HTML or Link field?

    Hey bstonehill,

    I'm moving this to the Developers forum, where you should get some more targeted answers.

    What are you editing to add the JavaScript? Are you using Studio or modifying the code/templates yourself? I know you can do this without changing securexss(), I just need more info.
    Julian Ostrow
    Systems and Applications Engineer
    SugarCRM Inc.

  4. #4
    bstonehill is offline Sugar Community Member
    Join Date
    Nov 2006
    Location
    Atlanta, GA
    Posts
    98

    Default Re: Javascript in HTML or Link field?

    Nevermind, got a workaround I think
    Last edited by bstonehill; 2008-07-02 at 10:07 PM.

  5. #5
    Danielg42 is offline Sugar Community Member
    Join Date
    Jun 2006
    Location
    Orange County, CA
    Posts
    187

    Default Re: Javascript in HTML or Link field?

    You can always input the code directly to the field's row in the "fields_meta_data" table of the database.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. custom field of html type with dynamic querystring???
    By dogfuel in forum Developer Help
    Replies: 9
    Last Post: 2008-11-05, 07:05 AM
  2. Replies: 2
    Last Post: 2008-03-28, 08:25 PM
  3. Replies: 0
    Last Post: 2008-02-01, 08:01 PM
  4. Replies: 2
    Last Post: 2006-06-13, 11:24 AM
  5. Replies: 2
    Last Post: 2005-05-11, 02:36 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
  •