dimanche 28 avril 2019

How can users upload a post to our website - like with instagram

We are setting up a food social media website - where users upload a recipe to our website as a post - like how people upload posts to Instagram.

We have tried saving all of the forms submissions into an HTML page use document.write just now we need that to appear on our website with all of the other posts

function getcode() {
  var nameinput = document.getElementById("name").value;
  document.getElementById("name1").innerHTML = nameinput;

  var ingreinput = document.getElementById("ingre").value;
  document.getElementById("ingre1").innerHTML = ingreinput;
}
<form id="form" onsubmit="return false;">
  <input type="text" placeholder="Name" id="name">
  <input type="text" placeholder="Ingredients" id="ingre">
  <input type="submit" onclick="getcode();" />
</form>


<p id="name1"></p>
<p id="ingre1"></p>



Aucun commentaire:

Enregistrer un commentaire