I have a mixture of input fields, textareas and combo boxes which I would like to be able to update one at a time (without page refresh) but I am not quite sure how to approach this. When update is clicked it should update the MySQL Database respectively. I know how to update all of them at the same time but I am trying to avoid using this method. Every input, textarea, combo has a input type submit next to them to get me started.
This is part of the html file that I am referring too.
<form action="" class="customform" method="post" id="file-upload-form" enctype="multipart/form-data">
<h5>Set competition name</h5>
<input type="text" id="Gamename" name="Gamename" value="<?php echo $GameName; ?>" size="400" style="max-width: 410px"> <input name="Update1" type="submit" value="Update" style="width: auto;">
<h5>Set competition date & time</h5>
<input type="text" id="demo" name="timedate" value="<?php echo $sdate; ?>" size="200" style="max-width: 210px"> <input name="Update2" type="submit" value="Update" style="width: auto;">
What would be the best way to achieve this? Would I need to use Ajax, Javascript or Jquery? I am not asking for all the code to be written for me, just some guidance on how to approach it. thanks
2
Answers
this was done by ajax full code is here with all guidance.
https://steemit.com/utopian-io/@sogata/how-to-update-data-mysql-from-php-without-reload-page-using-jquery-ajax
Try:
HTML
JS
You don’t need jQuery for such a simple task.