Hope you can help me with this. I have a html form with multiple text fields and two text areas.I use php for retrieving data from mysql database I've created a function initvars():
function initVars() {
//declaring variables
global $id,$ccode,$lno,$ldate,$apply_to,$type,$lexpiry,$smexpiry,$status,
$version,$patch,$hname,$hostid,$plat,$cpus,$company,$country,$var,
$contact, $email,$po,$inv, $invdate,$notes, $find, $reset, $next, $previous;
$id="";
$lno = "";
$ldate="";
$apply_to="";
$type="";
$find = "";
$reset="";
$next="";
$previous="";
$apply_to="";
$lexpiry="";
$smexpiry="";
$status="";
$version="";
$patch="";
$hname="";
$hostid="";
$plat="";
$cpus="";
$company="";
$ccode = "";
$country="";
$var="";
$contact="";
$email="";
$po="";
$inv="";
$invdate="";
$notes="";
$history="";
$message ="";
$resultOffset=0;
}
Then Im calling that function under my reset button:
if ($reset){
initVars();
}
Ant thats a piece of html for my text area:
<tr><td>
<h3>History</h3>
<textarea name="history" cols="100" rows="5" wrap="virtual"><?php echo
$history;?></textarea>
</td></tr>
And my reset button:
<input type="submit" name="reset" value="Reset"/></td></tr></table>
For some unknown for me reason every time I hit reset button all text fields and one text area are cleared but just this "history" text area still holds retrieved data. Did anyone have similar problem or anyone know how to fix it. Any advise highly appreciated. I can paste more code if needed. Thank you all