So here's my problem:
I have a voting form of sorts.. if a user hasn't voted yet, the form fields are blank. if the user has voted, the fields will be filled in by the variables (used with objects). The fields in question are 5 select boxes, and 5 textarea fields.
If the user hasn't voted, and fills out the form, hitting the "clear" button (a standard reset input field) clears the form. However, if the php variables are "filled in", the form no longer clears. I have scoured google and the only options I've seen appear to be tricky... especially since I didn't want to have to reload the page to clear the form.
Do any of you know an easy solution to this?
thanks!
Oh, here's the code for the part of the form that either has or doesnt have the variables in it:
<FORM METHOD="POST" ACTION="vote.php?theme=<?=$theme?>">
<INPUT TYPE="hidden" NAME="voted" VALUE="1">
<INPUT TYPE="hidden" NAME="firstVoteName2" VALUE=<?=$firstVoteName?>>
<?php
for ($j = 0; $j < 5; $j++)
{
$result = query();
?>
<TD>
<?
//$name = "series".$j;
//echo $name;
?>
<SELECT NAME="<?=$seriesSelected[$j] ?>">
<OPTION> </OPTION>
<?php
$myArray = arrayFill($result);
for ($i = 0; $i < sizeof($myArray); $i++)
{ ?>
<OPTION <? if($series[$j])
{
if ($series[$j]->GetSeriesVote() == $myArray[$i])
{echo "SELECTED";}
}?>><?=$myArray[$i]?></OPTION>
<? } ?>
</SELECT><BR><BR>
<TEXTAREA NAME="<?=$textarea[$j]?>" ROWS="5" COLS="39"><?if($series[$j]){ echo $series[$j]->GetComment();}?></TEXTAREA></TD>
<?php if (((++$j) % 2) == 0) { echo "</TR><TR><TD COLSPAN='2' HEIGHT='15'> </TD></TR><TR>"; } ?>
<? $j--;}
?>
</TR>
<TR>
<TD COLSPAN="2">
<INPUT CLASS="select" TYPE="submit" VALUE="Submit"> <INPUT TYPE="reset" CLASS="select" VALUE="Clear">
</FORM>