Jump to content

How to refresh a div on button click


sanatzzz

Recommended Posts

I have multiple divisions on my page..

what happens is by having next and previous buttons on my page i can browse thru the divisions...

now i have save and delete on each page, i enter some values in the textboxes of the respective divs and they get saved or deleted..

i want to refresh those textboxes after saving or deleting, as the textboxes retrieve the values from database and show as their values..

now i don't want to  refresh the page as i would have to start again from the first div even i was on lets say 55th div...

is there a way that the textbox values can be refresh on lets say a refresh button or the whole division gets refreshed...

all i want is the textboxes to be updated to the recent value without the whole page being refreshed...

any help would be welcome..

 

 

 

        

Link to comment
https://forums.phpfreaks.com/topic/295273-how-to-refresh-a-div-on-button-click/
Share on other sites

Following example may help you:

 
<!DOCTYPE html>

<html>

<body>



<p>Enter some text in the fields below, then press the "Reset form" button to reset the form.</p>



<form id="myForm">

  First name: <input type="text" name="fname"><br>

  Last name: <input type="text" name="lname"><br><br>

  <input type="button" onclick="myFunction()" value="Reset form">

</form>



<script>

function myFunction() {

    document.getElementById("myForm").reset();

}

</script>



</body>

</html>

 
 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.