0
    <script>
function sendWebhook() {

    var http = new XMLHttpRequest();
    var url = 'here is the link of the webhook';
    var content = {
  "content": " the form data will go here "
};
    http.open('POST', url, true);


    http.setRequestHeader('Content-type', 'application/json');

    http.onreadystatechange = function() {
        if(http.readyState == 4 && http.status == 200) {
            alert(http.responseText);
        }
    }
    http.send(JSON.stringify(content));
}
</script>

<input id="plswork" type="text" value="clickeame" onclick="webhookdata()" />
<input id="contact-submit" type="button" class="btn btn-transparent" value="clickeame" onclick="sendWebhook()" />

Here is my code , i want the <input id="plswork" to send the data to the content of the POST form of the webhook , i tried switching it and using functions but it wont work , help!

  • Does this answer your question? [How do I get the value of text input field using JavaScript?](https://stackoverflow.com/questions/11563638/how-do-i-get-the-value-of-text-input-field-using-javascript) – gfpacheco Jul 25 '20 at 13:57
  • Instead of asking questions about your code, try to search for what you're trying to do. In this case: "how to get the value of an input in javascript". – gfpacheco Jul 25 '20 at 13:58

0 Answers0