desperate for help with not refreshing page
i've been trying to solve this on my own for over a week, i'm no expert and have read tutorial after tutorial but i'm at dead end and ready to give up.
i have a search form that a user selects item from dynamic list hits the submit button and it returns each matching result on same page in an update form, i have 2 checkboxes in update form that updates the DB when 1 is checked, this all works fine until i check the checkbox the data updates ok but all remaining update forms are removed because the page refreshes.
so i need to update formst with out page refreshing but i cant get it to work with multiple forms on same page
- <body>
<form id="form1" name="form1" method="post" action="searchresults.php">
<label for="team"></label>
<select name="team" id="team">
<?php
do {
?>
<option value="<?php echo $row_Recordset1['TeamID']?>"><?php echo $row_Recordset1['TeamName']?></option>
<?php
} while ($row_Recordset1 = mysql_fetch_assoc($Recordset1));
$rows = mysql_num_rows($Recordset1);
if($rows > 0) {
mysql_data_seek($Recordset1, 0);
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
}
?>
</select>
<input type="submit" name="search" id="search" value="Submit" />
</form>
<p><?php echo $_POST['team'] ?> </p>
<p>
<?php echo print_r($_POST); ?>
</p>
<p> </p>
<?php
-
do { ?>
<form id="form2" name="form2" method="POST" action="<?php echo $editFormAction; ?>">
<label for="player"></label>
<input <?php if (!(strcmp($row_rsTeamselect['playing'],1))) {echo "checked=\"checked\"";} ?> name="play" type="checkbox" id="play" value="1" onclick="this.form.submit()" />
<input <?php if (!(strcmp($row_rsTeamselect['sub'],1))) {echo "checked=\"checked\"";} ?> name="sub" type="checkbox" id="sub" value="1" onclick="this.form.submit()"/>
<input name="squadnum" type="text" id="squadnum" value="<?php echo $row_rsTeamselect['squadnumber']; ?>" />
<input name="player" type="text" id="player" value="<?php echo $row_rsTeamselect['playername']; ?>" />
<label for="squadnum"></label>
<label for="play"></label>
<label for="sub"></label>
<input type="hidden" name="MM_update" value="form2" />
</form>
<?php } while ($row_rsTeamselect = mysql_fetch_assoc($rsTeamselect)); ?>
<p> </p>