Downloads:

HTML FORM SUBMIT WITHOUT RELOAD PAGE


Introduction

If you have HTML forms on your website and you don't want the page to reload when the form is submitted. Then we have a very quick and easy solution for you. You don't have to change anything, just add our easyform API. This will automatically adjust your forms and you can submit your forms to your PHP file without reloading.

Getting started

The output of your php you can easily add to your html like following. Put the following code somewhere in your <body></body> tag you like.

<div id="getcontent"></div>
Example:
<html>
<head></head>
<body>
<div id="getcontent"></div>
</body>
</html>

Fastest way to getting started with our lightweight easyform.js

<script src="https://www.profistart.com/api/easyform.js" defer></script> 

In your HTML add in <head></head> section the link above:

Example:
<html>
<head>
<script src="https://www.profistart.com/api/easyform.js" defer></script>
</head>
<body></body>
</html>

Thats all!



Now you get a full example with html form input field and submit button. In the form action are example php files with the safer method post.

HTML:
<html>
<head>
<script src="https://www.profistart.com/api/easyform.js" defer></script>
</head>
<body>

Form 1:
<form action="myfile_1.php" method="post">
  <input type="text" id="placeholder" name="placeholder" value="placeholder">
  <input type="submit" name="placeholder" value="submit">
</form>

Form 2:
<form action="myfile_2.php" method="post">
  <input type="text" id="placeholder" name="placeholder" value="placeholder">
  <input type="submit" name="placeholder" value="submit">
</form>

<div id="getcontent"></div>

</body>
</html>
PHP:

<?php

echo "I am respond from myfile_1.php";

?>

<?php

echo "I am respond from myfile_2.php";

?>

OUTPUT:

Form 1:


Form 2:



Feel free to contact us, if you have questions - support@profistart.com