Publishing to a Form Field and Internet Button

I’m trying to create an Arm and Disarm button on a webpage. But for some reason I can’t get past the proper arg format using the “Internet Button”… I wanted to build a webpage to arm the Particle or disarm the particle at which case it would send notification or not send notification while at the same time turn on an LED to notify me visually the system is armed. Here’s my code.

#include <InternetButton.h>

const String data = "";
InternetButton b = InternetButton();

void setup() {
    pinMode(D0, INPUT);
    pinMode(D1, OUTPUT);
    b.begin();
}

void loop() {
    b.Arm();
    pinMode(D1, HIGH);
    b.Disarm();
    pinMode(D1, LOW);
    if (digitalRead(D0) == HIGH && D1 == HIGH) {
         Particle.publish("Motion Detect", data, PRIVATE);
         digitalWrite(D6, HIGH);
         delay (30000);
       // hang tight here until motion stops
    }
    if (digitalRead(D0) == HIGH && D1 == LOW) {
         digitalWrite(D6, HIGH);
         delay (30000);
       // hang tight here until motion stops
    }
    else if (digitalRead(D0)== LOW){
        digitalWrite(D6, LOW);
    }
}

I’ve got a webpage that I found a Javascript to call the arm disarm function. But I think I’ve messed it up. Anyone with any ideas of how to fix it? Thanks in advance.

<html>
  <head>
      <title>SSN SMS Send</title>
  </head>
  <body>
    <button type="button" onclick="functionArm('Arm', 'b.Arm')">ARM</button>
    <button type="button" onclick="functionDisarm('Disarm', 'b.Disarm')">DISARM</button>

    <script src="http://cdn.jsdelivr.net/sparkjs/1.0.0/spark.min.js"></script>
    <script>
      var accessToken = "MYACCESSTOKEN";
  var deviceID = "MYDEVICEID"; 
  spark.on('login', function(response) {   
    console.log(response);
  });

  var callback = function(err, data) {
    if (err) {
      console.log('An error occurred while getting core attrs:', err);
    } else {
      console.log('Core attr retrieved successfully:', data);
    }
  };
  
  function functionArm(functionName, functionArgument){
    spark.callFunction(deviceID, functionName, functionArgument, callback);  
  }
  function functionDisarm(functionName, functionArgument){
    spark.callFunction(deviceID, functionName, functionArgument, callback);  
  }
  spark.login({ accessToken: accessToken });
</script>
  </body>

Or is there an easier way of doing this? I’m open for Suggestions. Sorry if I posted this in the wrong Area.