By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,299 Members | 1,242 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,299 IT Pros & Developers. It's quick & easy.

Drop-down options 4 rows at a time

P: n/a
Hi, I am trying to make a drop-down option for fields but not just for
adding one row at a time. I am trying to put in the code for adding
four rows at a time, which is what I'm trying to do below. Please
advise. You will have to copy and past the HTML code below and open it
to see what I'm talking about.
Thanks very much

<HTML>

<head>
<meta http-equiv="Content-Language" content="en-us">
</head>

<FORM>
<TABLE>
<TR VALIGN="top">
<TD><INPUT TYPE=text NAME="name_8" SIZE="20" MAXLENGTH="100"
VALUE=""></TD>
<TD><INPUT TYPE=text NAME="name_11" SIZE="20" MAXLENGTH="100"
VALUE=""></TD>
<TD><INPUT TYPE=text NAME="name_10" SIZE="20" MAXLENGTH="100"
VALUE=""></TD>
<TD><INPUT TYPE=text NAME="name_28" SIZE="20" MAXLENGTH="100"
VALUE=""></TD>
<TD><INPUT TYPE=text NAME="name_9" SIZE="20" MAXLENGTH="100"
VALUE=""></TD>
</TR>
<TR VALIGN="top">
<TD><INPUT TYPE=text NAME="name_6" SIZE="20" MAXLENGTH="100"
VALUE=""></TD>
<TD><INPUT TYPE=text NAME="name_12" SIZE="20" MAXLENGTH="100"
VALUE=""></TD>
<TD><INPUT TYPE=text NAME="name_13" SIZE="20" MAXLENGTH="100"
VALUE=""></TD>
<TD><INPUT TYPE=text NAME="name_29" SIZE="20" MAXLENGTH="100"
VALUE=""></TD>
<TD><INPUT TYPE=text NAME="name_7" SIZE="20" MAXLENGTH="100"
VALUE=""></TD>
</TR>
<TR VALIGN="top">
<TD><INPUT TYPE=text NAME="name_4" SIZE="20" MAXLENGTH="100"
VALUE=""></TD>
<TD><INPUT TYPE=text NAME="name_14" SIZE="20" MAXLENGTH="100"
VALUE=""></TD>
<TD><INPUT TYPE=text NAME="name_15" SIZE="20" MAXLENGTH="100"
VALUE=""></TD>
<TD><INPUT TYPE=text NAME="name_30" SIZE="20" MAXLENGTH="100"
VALUE=""></TD>
<TD><INPUT TYPE=text NAME="name_5" SIZE="20" MAXLENGTH="100"
VALUE=""></TD>
</TR>
<TR VALIGN="top">
<TD><INPUT TYPE=text NAME="name_1" SIZE="20" MAXLENGTH="100"
VALUE=""></TD>
<TD><INPUT TYPE=text NAME="name_16" SIZE="20" MAXLENGTH="100"
VALUE=""></TD>
<TD><INPUT TYPE=text NAME="name_17" SIZE="20" MAXLENGTH="100"
VALUE=""></TD>
<TD><INPUT TYPE=text NAME="name_31" SIZE="20" MAXLENGTH="100"
VALUE=""></TD>
<TD><INPUT TYPE=text NAME="email_1" SIZE="20" MAXLENGTH="100"
VALUE=""></TD>
</TR>
<TR ID="recip_2" STYLE="DISPLAY:NONE;" VALIGN="top">
<TD><INPUT TYPE=text NAME="email_13" SIZE="20" MAXLENGTH="100"
VALUE=""></TD>
<TD><INPUT TYPE=text NAME="email_12" SIZE="20" MAXLENGTH="100"
VALUE=""></TD>
<TD><INPUT TYPE=text NAME="email_11" SIZE="20" MAXLENGTH="100"
VALUE=""></TD>
<TD><INPUT TYPE=text NAME="name_32" SIZE="20" MAXLENGTH="100"
VALUE=""></TD>
<TD><INPUT TYPE=text NAME="email_10" SIZE="20" MAXLENGTH="100"
VALUE=""></TD>
</TR>
<TR ID="recip_2" STYLE="DISPLAY:NONE;" VALIGN="top">
<TD><INPUT TYPE=text NAME="email_9" SIZE="20" MAXLENGTH="100"
VALUE=""></TD>
<TD><INPUT TYPE=text NAME="name_18" SIZE="20" MAXLENGTH="100"
VALUE=""></TD>
<TD><INPUT TYPE=text NAME="name_19" SIZE="20" MAXLENGTH="100"
VALUE=""></TD>
<TD><INPUT TYPE=text NAME="name_33" SIZE="20" MAXLENGTH="100"
VALUE=""></TD>
<TD><INPUT TYPE=text NAME="email_8" SIZE="20" MAXLENGTH="100"
VALUE=""></TD>
</TR>
<TR ID="recip_2" STYLE="DISPLAY:NONE;" VALIGN="top">
<TD><INPUT TYPE=text NAME="email_6" SIZE="20" MAXLENGTH="100"
VALUE=""></TD>
<TD><INPUT TYPE=text NAME="name_20" SIZE="20" MAXLENGTH="100"
VALUE=""></TD>
<TD><INPUT TYPE=text NAME="name_21" SIZE="20" MAXLENGTH="100"
VALUE=""></TD>
<TD><INPUT TYPE=text NAME="name_34" SIZE="20" MAXLENGTH="100"
VALUE=""></TD>
<TD><INPUT TYPE=text NAME="email_7" SIZE="20" MAXLENGTH="100"
VALUE=""></TD>
</TR>
<TR ID="recip_2" STYLE="DISPLAY:NONE;" VALIGN="top">
<TD><INPUT TYPE=text NAME="email_5" SIZE="20" MAXLENGTH="100"
VALUE=""></TD>
<TD><INPUT TYPE=text NAME="name_22" SIZE="20" MAXLENGTH="100"
VALUE=""></TD>
<TD><INPUT TYPE=text NAME="name_23" SIZE="20" MAXLENGTH="100"
VALUE=""></TD>
<TD><INPUT TYPE=text NAME="name_35" SIZE="20" MAXLENGTH="100"
VALUE=""></TD>
<TD><INPUT TYPE=text NAME="email_4" SIZE="20" MAXLENGTH="100"
VALUE=""></TD>
</TR>
<TR ID="recip_2" STYLE="DISPLAY:NONE;" VALIGN="top">
<TD><INPUT TYPE=text NAME="name_2" SIZE="20" MAXLENGTH="100"
VALUE=""></TD>
<TD><INPUT TYPE=text NAME="name_24" SIZE="20" MAXLENGTH="100"
VALUE=""></TD>
<TD><INPUT TYPE=text NAME="name_25" SIZE="20" MAXLENGTH="100"
VALUE=""></TD>
<TD><INPUT TYPE=text NAME="name_36" SIZE="20" MAXLENGTH="100"
VALUE=""></TD>
<TD><INPUT TYPE=text NAME="email_2" SIZE="20" MAXLENGTH="100"
VALUE=""></TD>
</TR>
<TR ID="recip_3" STYLE="DISPLAY:NONE;" VALIGN="top">
<TD><INPUT TYPE=text NAME="name_3" SIZE="20" MAXLENGTH="100"
VALUE=""></TD>
<TD><INPUT TYPE=text NAME="name_26" SIZE="20" MAXLENGTH="100"
VALUE=""></TD>
<TD><INPUT TYPE=text NAME="name_27" SIZE="20" MAXLENGTH="100"
VALUE=""></TD>
<TD><INPUT TYPE=text NAME="name_37" SIZE="20" MAXLENGTH="100"
VALUE=""></TD>
<TD><INPUT TYPE=text NAME="email_3" SIZE="20" MAXLENGTH="100"
VALUE=""></TD>
</TR>
<TR><TD COLSPAN="5" ALIGN="right" CLASS="mainbodytext">
<DIV ALIGN="CENTER">Additional Rows:
<SELECT NAME="recip_numb" ONCHANGE="reveal(this);">
<OPTION VALUE="1" SELECTED> 1</OPTION>
<OPTION VALUE="2"> 2</OPTION>
<OPTION VALUE="3"> 3</OPTION>
<!--OPTION VALUE="4"> 4</OPTION>
<OPTION VALUE="5"> 5</OPTION-->
</SELECT>
</DIV>
</TD>
</TR>
</TABLE>
</FORM>
<SCRIPT LANGUAGE="JavaScript" type="text/javascript">
function reveal(s) {
var val = s.options[s.selectedIndex].value;
if (val > 1) {
for (var i = 2; i <= val; i++) {
if (document.getElementById) {
document.getElementById('recip_' + i).style.display = '';
} else if (document.all) {
document.all['recip_' + i].style.display = '';
}
}
} else {
for (var i = s.options.length; i > 1; i--) {
if (document.getElementById) {
document.getElementById('recip_' + i).style.display = 'none';
} else if (document.all) {
document.all['recip_' + i].style.display = 'none';
}
}
}

}
</SCRIPT>
</HTML>

Jul 23 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
You have multiple elements with the same id. You can't do that. Fix
that and I bet your other problems go away.
Jul 23 '05 #2

P: n/a
Thank you so much...you were a big help!!!!

Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.