Git Product home page Git Product logo

Comments (6)

dagoss avatar dagoss commented on May 18, 2024 1

@mckennapsean After using this script for a little project, I think I would have liked the listener event to be attached to forms with a specific data-* attribute. Something like data-form="gform". The script isn't really complicated as-is, but having to go in and manually edit the form handler wasn't really expected based on the project's README (which lead me to think it was generic and I could just drop it in and it'd hook into any form submission on that page)

I used this in a project that used nodejs, so what I was really hoping for was to do something like this for forget about it:

gform = require('google-form-submitter')
gform.init('my-form-id');
// event now bound to #my-form-id

Want me to do a PR?

from learn-to-send-email-via-google-script-html-no-server.

estettin avatar estettin commented on May 18, 2024

That could work, but could you be more specific

from learn-to-send-email-via-google-script-html-no-server.

dagoss avatar dagoss commented on May 18, 2024

The form-submission-handler.js currently has some opinionated logic in it. For example, it expects the form to have a specific ID and have a field named email.

It would be nice if any form could be submitted, without looking for special field names and stuff like that.

from learn-to-send-email-via-google-script-html-no-server.

mckennapsean avatar mckennapsean commented on May 18, 2024

Definitely agree there, @dagoss. What is the best solution, do you think? Should it be a variable passed into a function that declares which form to grab data from? Or something else? We could also improve the email thing by only performing this check if such a field exists. I have just commented out that code when I haven't needed it myself.

One part of the issue is about the type of data which the form can send and store in Google Spreadsheet/email. After some PR's I sent in, this should be working with anything a browser supports (with the possible exception of IE).

from learn-to-send-email-via-google-script-html-no-server.

mckennapsean avatar mckennapsean commented on May 18, 2024

By all means, you are welcome to! That makes sense and sounds fairly sane, and it could even then support multiple forms on a single page with the same script. :)

from learn-to-send-email-via-google-script-html-no-server.

mckennapsean avatar mckennapsean commented on May 18, 2024

As a note, this original issue seems to be about:

A) supporting multiple types of input/form elements and form data

But we have also steered this discussion (based on the title, I think) onto:

B) Making the form more generic / support more options and customizations and be less "opinionated" or allow those assumptions to be overridden.

A) has been addressed in #17 (with the exception of images/files in other issues) with the test.html file, and then B) I will add a new issue about, so feel free to continue discussion in the relevant issues.

from learn-to-send-email-via-google-script-html-no-server.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.