blk
12-09-2004, 02:35 PM
I need to write a javascript function. There are two fields "Number of Items" and "Item ID". "Item ID" has 5 input fields. If the field "Number of Items" is chosen as 1, then "Item ID" needs 1 Id input. If the "Number of Items" is 2, 2 ID inputs are needed and so on. Could anybody help me in writing this function please. Thanks in advance.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Accomodation form</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<META content="MSHTML 6.00.2800.1458" name=GENERATOR>
</HEAD>
<BODY vLink=#006600 link=#3333ff bgColor=white>
<FORM action=" " method=post>
<h1>Enter the details</h1>
<TABLE cellSpacing=0 cellPadding=0 border=0>
<TR>
<TD align=left>Number of Items</TD>
<TD width="84"><INPUT maxLength=55 size=10 name=number></TD></TR>
<TR>
<TD align=left>Item ID</TD>
<TD width="84"> <input name=id_1 size=10></TD>
<TD><input name=id_2 size=10></TD>
<TD><input name=id_3 size=10></TD>
<TD><input name=id_4 size=10></TD>
<TD><input name=id_5 size=10></TD>
</TR>
<TR>
<TD></TD></TR>
<TR>
<TD></TD></TR>
<TR>
<TD width="200"><INPUT type=submit value=Submit><INPUT type=reset value="Clear Form">
</TD></TR>
</TABLE>
</FORM>
</BODY>
</HTML>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Accomodation form</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<META content="MSHTML 6.00.2800.1458" name=GENERATOR>
</HEAD>
<BODY vLink=#006600 link=#3333ff bgColor=white>
<FORM action=" " method=post>
<h1>Enter the details</h1>
<TABLE cellSpacing=0 cellPadding=0 border=0>
<TR>
<TD align=left>Number of Items</TD>
<TD width="84"><INPUT maxLength=55 size=10 name=number></TD></TR>
<TR>
<TD align=left>Item ID</TD>
<TD width="84"> <input name=id_1 size=10></TD>
<TD><input name=id_2 size=10></TD>
<TD><input name=id_3 size=10></TD>
<TD><input name=id_4 size=10></TD>
<TD><input name=id_5 size=10></TD>
</TR>
<TR>
<TD></TD></TR>
<TR>
<TD></TD></TR>
<TR>
<TD width="200"><INPUT type=submit value=Submit><INPUT type=reset value="Clear Form">
</TD></TR>
</TABLE>
</FORM>
</BODY>
</HTML>