2 Replies Latest reply on Jun 4, 2014 5:57 AM by macrolide

    Triggering a script from a web-viewer

    macrolide

      Title

      Triggering a script from a web-viewer

      Post

           I have a database with 2 fields that I want to populate using data submitted from a form rendered in web viewer. The Calculation for the web viewer is

      
      "data:text/html," & "<html><body style=\"margin:4px; border:0; font: 10pt normal arial, sans-serif;\">
      
      
      <form onsubmit=\"return submitForm()\">
      <input id=\"pass\" type=\"text\" /><br />
      <input type=\"submit\" value=\"OK\" />
      </form>
      
      <script>
      function submitForm() {
      theParam = document.getElementById(\"pass\").value;
      theURL = \"fmp://$/" & Get ( FileName ) & "\?script=Password&param=\" + theParam;
      window.location = theURL ;
      document.getElementById(\"pass\").value = \"\";
      return false;
      } 
      </script>
      </body>
      </html>"

           I created a script with the name "Password" that has the following script steps

             
      1.           Set Variable[$input; Value:Get(ScriptParameter)]
      2.      
      3.           New Record/Request
      4.      
      5.           Set Field [CALCS::interval_RR; $input]
      6.      
      7.           Commit Records/Requests

           OnSubmit from web viewer nothing happens! Any suggestions on how to fix this?