martinjsmith
07-23-2002, 01:07 PM
The first section below is PHP which simply outputs some HTML form components (2 selects and 2 texts). Each of these components are named as arrays as they are generated inside a for loop which works fine. My problem is that I cant access the components using the HTML line at the end of my code in the normal way. All I want to do is set the 'signUpListLocation[]' component's value to 'empty string' but I'm not sure about the syntax of accessing the array variable. Suggestions most welcome...
Martin
<HTML>
<?PHP
$numSession=8;
for ($i = 0; $i < $numSessions; $i++)
{
echo("<TR><TD><SELECT NAME='signUpListDay[]'>");
echoDays();
echo("</SELECT></TD>");
echo("<TD><SELECT NAME='signUpListTime[]'>");
echoTimes();
echo("</SELECT></TD>");
echo("<TD><INPUT TYPE=TEXT NAME='signUpListLocation[]' SIZE=40></TD>");
echo("<TD><INPUT TYPE=TEXT NAME='signUpListWeeks[]' SIZE=15></TD>");
}
?>
<TD><a href='#' onMouseOver="window.document.newForm.signUpListLocation[0].value='empty string';">Reset</a></TD></TR>
</HTML>
Martin
<HTML>
<?PHP
$numSession=8;
for ($i = 0; $i < $numSessions; $i++)
{
echo("<TR><TD><SELECT NAME='signUpListDay[]'>");
echoDays();
echo("</SELECT></TD>");
echo("<TD><SELECT NAME='signUpListTime[]'>");
echoTimes();
echo("</SELECT></TD>");
echo("<TD><INPUT TYPE=TEXT NAME='signUpListLocation[]' SIZE=40></TD>");
echo("<TD><INPUT TYPE=TEXT NAME='signUpListWeeks[]' SIZE=15></TD>");
}
?>
<TD><a href='#' onMouseOver="window.document.newForm.signUpListLocation[0].value='empty string';">Reset</a></TD></TR>
</HTML>