Submit a Form with a Button (Html)
I Am Making a Program That Would Post on a Webpage, to Submit the Form It Has to "Click" on a Button: Send from What I Know (Not Much) to Submit a Post Request...
I am making a program that would post on a webpage, to submit the form it has to "click" on a button:
<button class="form" type="submit">Send</button>
From what I know (not much) to submit a POST request when it's INPUT you must do name=value, but I don't know how I could do that with a submit button.
Basically I want to know what I must POST to the website so that it submits the form :p
1 Answer
Here's basic syntax for a form:
<form>
<input name="name" type="text"/>
<button type="submit"> Send </button>
</form>
Whatever backend you are using should be able to read POST request parameter "name" to read what that form contains.
If you're trying to make a form with just that one button, you can do that by just skipping that input element. Of course, there will be no data in that post request, but you can add the action attribute to the containing form and set it equal to a URL where you would like to redirect the user on button click.