We are using below code to update the form fields in a database
<form action="profile.php" method="POST">
Name :
<input type="text" name="txtuname" value="<?php echo $row['userName'] ?>" /><br/>
Email :
<input type="text" name="txtemail" value="<?php echo $row['userEmail'] ?>" />
<input id="sub" type="submit" name="submit" value="Save" style="display:none" />
<button class = "pedit" name="submit" onclick="work()">Edit</button>
</form>
script
<script>function work()
{
var see = document.getElementsByName("submit");
for (i = 0; i < see.length; i++)
{
see[i].style.display = see[i].style.display === 'none' ? 'block' : 'none'; }}
</script>
both form fields, edit and save
parts are displaying in only one page & using only same css.