Jump to content

no refresh after update


kenny22

Recommended Posts

i have set up a search form which is linked to dynamic update form on the same page,

 

when you pick an item from listbox in form 1 it will populate form2 (update form) with the  data from DB and repeat for all matching records, the update of the form is done by using a checkbox (onclick), all this works fine and DB updates fine.

 

My problem is when i check a  checkbox in any of the update forms the data is updated but all the update forms are removed so if i want to update another record i need to  enter original search again to  get forms to display again

 

i know the problem is because the page is refreshing when onclick is activated and it loses the search value so returns empty form.

 

i know you can use java to stop page refreshing but never used it before and been trying to get it to work with no success, is there any other way to keep page from refreshing

Link to comment
https://forums.phpfreaks.com/topic/231763-no-refresh-after-update/
Share on other sites

Not completely understanding what is going on, but if you're submitting a form, using the normal submit process, the page has to reload and cannot be stopped. You could do this with Ajax and the page wouldn't refresh, but instead your client side Javascript would make all the necessary changes after its call to the server.

i've narrowed down the problem to this bit of code

 

$colname_rsTeamselect = "-1";
if (isset($_POST['team'])) {
  $colname_rsTeamselect = $_POST['team'];

 

when i click to update form it  reloads form  using $colname_rsTeamselect = "-1"; instead of holding the previous value of $colname_rsTeamselect

 

so i'm looking for a way to hold the value of $colname_rsTeamselect until a new $_POST['team'] is entered from search box

 

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.