using post from any button

Solutions on MaxInterview for using post from any button by the best coders in the world

showing results for - "using post from any button"
Simone
17 Jan 2018
1	$('.btn-logout').on('click', function() {
2		$('<form action="<?=$url_local?>member/logout" method="post"> <input name="token" value="<?= $obj_user ? $obj_user['token'] : '' ?>"/> </form>').appendTo('body').submit();
3	});
Imrane
24 Jul 2020
1<form method='POST' action='myFile.php'>
2  <input name='myInput'>
3  <button type='submit'>Submit</button> 
4  <!--Sends input value to the page set as 'action' parameter. 
5	For example a php file.-->
6</form>
Matteo
12 Apr 2020
1form.addEventListener('submit', (event) => {
2  event.preventDefault(); //stop reload
3
4  let input = document.querySelector('input');
5
6  let method = 'GET';
7  let endpoint = `request url ${input.value}`;
8
9  xhr.open(method, endpoint);
10  xhr.send(); //if in the link what you looking for this send will be empty!!!
11});
queries leading to this page
how to use button to postsend post data when button is pressedpost with buttonshow to send a post request when a button is clicked in htmlsend post request with just button click javascriptpost request on html buttonhow to send post request with a simple buttonpost from buttonbutton send request in formbutton with post methoduse post method with buttonhtml button do not send requestpost request buttonhtml post request with buttonform with button post methodhtml on submit send to pagehow to make request for other button in javascriptsend post request with html buttonbutton method posthow to make button return post requestmake post request with buttonsend post request through button htmlmaking a button submit post requestpost request with button htmlsend post request html buttonhow to tell a button to send post requesthtml button with post methodpost request button for formhtml button post examplehow to send post request on button clickadd get request to button htmlpost request with buttonsend post request when something is clicked htmlhtml post request on button clicksend post request on button click javascriptjs button send post request html button send put requestmethod post buttonhow to post a method using buttonsend post data with button clickpost buttonbutton post methodhow to post using a buttonsend get request with button to endpointbutton onclick post requestpost request with a buttonpost post button can you send a button pressing requrestbutton on click post requestset get request on button click htmlbutton posthtml post request buttonuse post in buttonhow to send a post request from a button onlysend request on button post request on button click how to post from a buttonpost request using button using request formpost form by clickhtml button make post requesthow to use post method with buttonpost request on button clickhtml make button send posthow to post using buttonsend post data on button clickhtml button make javascript post requestpost and onclick buttonbutton post requestusing post from any buttonhtml button send post requesthtml button post requestget a request on html button clickhow to link a button to post requesthow to use post method with normal buttonusing post for form buttonpost send html 3cbutton type 3d 22submit 22 class 3d 22btn 22 name 3d 22create post 22 3esave post 3c 2fbutton 3epost request button htmlusing post from any button