New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

feedback-sd

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

feedback-sd

feedbackSD - javascript plugin for simple feedback form for any sites

  • 0.0.7
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

feedbackSD - javascript plugin for simple feedback form for any sites

Basic Usage without NPM

  1. аdd sript tag to head section of html
<head>
    <meta charset="UTF-8">
    <title>Строительный двор</title>
    <script src="./feedbackSD.min.js"></script>
</head>
  1. init in end of body section

<script>
  feedbackSD.init({id:'feedbackID', endpoin: 'localhost'})
</script>


## params for init function
ParamTypeDescriptionRequiredDefalt value
idstringid of an element for appending formTrue
endpoinstringurl for sending json with form dataTrue
btnTitlestringtext for feeddback btnFalse'Feedback'

Basic Usage with NPM (React example)

 npm install feedback-sd
import React from 'react';
import feedbackSD from 'feedback-sd';

class Form extends React.Component {

  constructor(props) {
    super(props);
    feedbackSD.initEndPoint('localhost')
    this.state = {name: '', email: '', text: ''};
    this.handleChangeName = this.handleChangeName.bind(this);
    this.handleChangeEmail = this.handleChangeEmail.bind(this);
    this.handleChangeText = this.handleChangeText.bind(this);
    this.handleSubmit = this.handleSubmit.bind(this);
  }

  handleSubmit(event) {
    feedbackSD.sendForm(event, {name: this.state.name, email: this.state.email, text: this.state.text})
    event.preventDefault();
  }

  handleChangeName(event) {
    this.setState({name: event.target.value});
  }

  handleChangeEmail(event) {
    this.setState({email: event.target.value});
  }

  handleChangeText(event) {
    this.setState({text: event.target.value});
  }

  render() {
    return (
      <form onSubmit={this.handleSubmit}>
        <input type="text" value={this.state.name} onChange={this.handleChangeName} />
        <input type="text" value={this.state.email} onChange={this.handleChangeEmail} />
        <input type="text" value={this.state.text} onChange={this.handleChangeText} />
        <button onClick={this.handleSubmit}>Отправить форму</button>
      </form>
    );
  }
}

export default Form;

Development mode

git clone https://github.com/dima-bu/feedbackSD.git
cd ./feedbackSD
npm i
npm run live

Open in browser http://localhost:9000

FAQs

Package last updated on 09 Aug 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc