Method Community

 

Adding JavaScript to a Method screen

Last post 11-02-2012 12:00 PM by LaCrews. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 11-01-2012 3:59 PM

    Adding JavaScript to a Method screen

    Has anybody had success getting a javascript to dynamically execute on Method screen?  When I add the following as the name of the label "Temp"  displays blue as expected.  When I update the label using enter value onto screen all I get is "Temp" displayed as black.   Anybody know how get the script to execute dynamically?

    <h1 id="p2">Temp</h1>

    <script type="text/javascript">
    document.getElementById("p2").style.color="blue";
    </script>

    Mark Crews
    Cloud Consultancy
    Principal and Developer


    • 2012 MethodCRM Partner of the Year

    • 2012 MethodCRM Community Excellence Award

    • 2011 MethodCRM Community Excellence Award


    Visit our website to find out about our training, support, and customization services.
    website: cloudconsultancyllc.com
    blog: cloudconsultancyllc.com/blog/
    ph: 434.326.1601
    e: support@cloudconsultancyllc.com

    What is Method?
  • 11-02-2012 9:25 AM In reply to

    Re: Adding JavaScript to a Method screen

    Answer

    LaCrews:
    Anybody know how get the script to execute dynamically?

    We do try to limit you from entering some javascript on labels but it looks like this slipped through.  We definitely prevent the execution (if we catch it) but your example managed to work prior to updating the value.  I would recommend against using javascript like this but I'm going to put a feature request in for the team here.  I can't say if or when this feature will be added as there are additional security concerns around this.

    ~C

  • 11-02-2012 12:00 PM In reply to

    Re: Adding JavaScript to a Method screen

    Hi Chad

    The example I provided is just a test to see if we could execute a script.  The end goal here is to be able to gather info like gps location, computer name, browser type, etc and use the new get  field/object ID action to insert the value onto a screen textbox and thereby persit it to the database.

    Mark Crews
    Cloud Consultancy
    Principal and Developer


    • 2012 MethodCRM Partner of the Year

    • 2012 MethodCRM Community Excellence Award

    • 2011 MethodCRM Community Excellence Award


    Visit our website to find out about our training, support, and customization services.
    website: cloudconsultancyllc.com
    blog: cloudconsultancyllc.com/blog/
    ph: 434.326.1601
    e: support@cloudconsultancyllc.com

    What is Method?
Page 1 of 1 (3 items)