Syntax error when inputting HTML / Javascript code into formula - text field.

  • 0
  • 1
  • Question
  • Updated 3 years ago
  • Answered
Hello All,

I am trying to get a custom html / java script to work as an active button on quickbase in a formula text field.

I have the code below

but since I am very new to working with quickbase I am unable to enter my code into the formula text field after I've enabled HTML. I get a Syntax error, can somebody explain what needs to be done to correct the error?

code below.

<html>
<head>
    <link href="http://addtocalendar.com/atc/1.5/atc-style-blue.css" rel="stylesheet" type="text/css">
</head>
<body>
    <script type="text/javascript">(function () {
            if (window.addtocalendar)if(typeof window.addtocalendar.start == "function")return;
            if (window.ifaddtocalendar == undefined) { window.ifaddtocalendar = 1;
                var d = document, s = d.createElement('script'), g = 'getElementsByTagName';
                s.type = 'text/javascript';s.charset = 'UTF-8';s.async = true;
                s.src = ('https:' == window.location.protocol ? 'https' : 'http')+'://addtocalendar.com/atc/1.5/atc.min.js';
                var h = d[g]('body')[0];h.appendChild(s); }})();
    </script>
    <span class="addtocalendar atc-style-blue">
        <var class="atc_event">
            <var class="atc_date_start">[Start Date] [Start Time]</var>
            <var class="atc_date_end">[End Date][End Time]</var>
            <var class="atc_timezone"></var>
            <var class="atc_title">[EMR Project Number]-[Task #] - [Client - Company Name] -[Activity]</var>
            <var class="atc_description">[Schedule Summary]</var>
            <var class="atc_location">[Address]</var>
            <var class="atc_organizer">EMR CPR SCHEDULE</var>
            <var class="atc_organizer_email">schedule@emrcpr.com</var>
        </var>
    </span>
</body>
</html>
Photo of Quickbase Generic User

Posted 3 years ago

  • 0
  • 1
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,064 Points 20k badge 2x thumb
You are trying to put a full HTML document into a formula. The only thing you can put into a formula field is a QuickBase formula definition. I think where you are getting confused is that a text formula can contain a limited set of HTML tags within it strings and field values but it is a very limited set of tags.

To accomplish placing this button on your page you need to use script. Fee free to contact me off world using information in my profile if you need help doing this as it involves a few different steps to set up correctly.