473,785 Members | 2,794 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

runtime input boxes

omerbutt
638 Contributor
hi there i am working on an inventory rpoject and for that i have made a stock entry form which is pasted below,I have included this form in the main Add Stock page, having the following inputs to be saved
1.code no
2part no
3total replace no's--------->this is wot the ques is about
4auto
5type
6brand
7height
8product
9outer dia 1
10 outer dia2
11inner dia1
12 inner dia 2
13unit price
NOw the client has the business of AUTO FILTERS ,means WATER SEP FILTER,OIL SEPERATOR FILTER ETC. Ror each filter they have different qualities for which they have a "Replacemen t No". This means if he has a Mobile of Nokia6230 he has this mobile in 3 Manufacturers and 2 pieces/Manufacturers, i.e uk made, china made, hungary made e.t.c he will assign 1 "Code No" and 3 different "Replace no" to these 3 different makes while entering the stock,now the prob is that the total number of "Replace Nos" are not fixed there can be 1 "Replace No" for 1 part and on the other hand 5 "Rep Nos " for another part ,what i am doing/trying to do is that i am using a div with a selection menu in which i want to give a serial of nos from 1 to onwards and i am using the "onchange" in the "Select" tag which is calling a javascript function which enables the other divs for eg if i have selected "3" in the "Total Replace Nos" option then it shud call the javascript function which shud enable 3 input boxes to enter the 3 replace nos for the part :( isnt it lengthy ...if there is a better way todo this thing do temme and thanks for any help in advance the code for the form is given here :
Expand|Select|Wrap|Line Numbers
  1.       <%
  2.           dim DateStatus
  3.           DateStatus=now()
  4.       %>
  5.       <tr>
  6.        <td>
  7.       <table cellspacing="0" cellpadding="0" width="690" align="center" valign="top" bordercolor="#4C4A48" height="170">
  8.       <tr><td class="add"><div align="left">Code No:</div></td>
  9.            <td width="150" align="Center" valign="Center"><div align="left"><input name="code_no" type="text" size="25" style="width:194px; height:17px; font-size:11px; font-family:tahoma; border-style:solid; border-width:1px; border-color:#4C4A48; color:#8C8B89; background-color:#0A0501 "></div></td>
  10.                   <td class="add"><div align="left">Part No:</div></td>
  11.                   <td width="150" align="Center" valign="Center"><div align="left"><input name="cust_name" type="text" size="25" style="width:194px; height:17px; font-size:11px; font-family:tahoma; border-style:solid; border-width:1px; border-color:#4C4A48; color:#8C8B89; background-color:#0A0501 "></div></td>
  12.               </tr>
  13.               <tr>           
  14.                   <td class="add"><div align="left">Total Replace No's:</div></td>
  15.                   <td class="150" align="center" valign="middle">
  16.                   <div align="left">
  17.                   <SELECT name="t_rep" onChange="" style=" width:194px; height:17px; font-size:11px; font-family:tahoma; border-style:solid; border-width:1px; border-color:#8C8B89; color:#8C8B89; background-color:#0A0501 ">
  18.                       <OPTION value="none" selected="selected">Please Select Any Number</OPTION>
  19.                       <option value="1">1</option>
  20.                       <option value="2">2</option>
  21.                       <option value="3">3</option>
  22.                       <option value="4">4</option>
  23.                   </select>
  24.                   </div>
  25.                   </td>
  26.                   <td class="add"><div align="left">Auto:</div></td>
  27.                   <td width="150" align="Center" valign="Center"><div align="left"><input name="cust_add" type="text" size="25" style="width:194px; height:17px; font-size:11px; font-family:tahoma; border-style:solid; border-width:1px; border-color:#4C4A48; color:#8C8B89; background-color:#0A0501 "></div></td>
  28.               </tr>
  29.               <tr>
  30.                   <td class="add"><div align="left">Replace No:</div></td>
  31.                   <td width="150" align="Center" valign="Center"><div align="left"><input name="cust_add" type="text" size="25" style=" width:194px; height:17px; font-size:11px; font-family:tahoma; border-style:solid; border-width:1px; border-color:#8C8B89; color:#8C8B89; background-color:#0A0501 "></div></td>
  32.                   <td class="add"><div align="left">Outer Dia1:</div></td>
  33.                   <td width="150" align="Center" valign="Center"><div align="left"><input name="toc_fr" type="text" size="25" style="width:194px; height:17px; font-size:11px; font-family:tahoma; border-style:solid; border-width:1px; border-color:#4C4A48; color:#8C8B89; background-color:#0A0501 "></div></td>
  34.               </tr>
  35.               <tr>
  36.                   <td class="add"><div align="left">Type:</div></td>
  37.                   <td width="150" align="Center" valign="Center"><div align="left"><input name="cust_add" type="text" size="25" style="width:194px; height:17px; font-size:11px; font-family:tahoma; border-style:solid; border-width:1px; border-color:#4C4A48; color:#8C8B89; background-color:#0A0501 "></div></td>
  38.                   <td class="add"><div align="left">Outer Dia2:</div></td>
  39.                   <td width="150" align="Center" valign="Center"><div align="left"><input name="toc_fr" type="text" size="25" style="width:194px; height:17px; font-size:11px; font-family:tahoma; border-style:solid; border-width:1px; border-color:#4C4A48; color:#8C8B89; background-color:#0A0501 "></div></td>
  40.               </tr>                                 
  41.               <tr>
  42.                   <td class="add"><div align="left">Brand:</div></td>
  43.                   <td ="#346598" width="150" align="Center" valign="Center"><div align="left"><input name="caller" type="text" size="25" style="width:194px; height:17px; font-size:11px; font-family:tahoma; border-style:solid; border-width:1px; border-color:#4C4A48; color:#8C8B89; background-color:#0A0501 "></div></td>
  44.                   <td class="add"><div align="left">Inner Dia1:</div></td>
  45.                   <td width="150" align="Center" valign="Center"><div align="left"><input name="toc_to" type="text" size="25" style="width:194px; height:17px; font-size:11px; font-family:tahoma; border-style:solid; border-width:1px; border-color:#4C4A48; color:#8C8B89; background-color:#0A0501 "></div></td>
  46.               </tr>
  47.               <tr>
  48.                   <td class="add"><div align="left">Height:</div></td>
  49.                   <td ="#346598" width="150" align="Center" valign="Center"><div align="left"><input name="caller" type="text" size="25" style="width:194px; height:17px; font-size:11px; font-family:tahoma; border-style:solid; border-width:1px; border-color:#4C4A48; color:#8C8B89; background-color:#0A0501 "></div></td>
  50.                   <td class="add"><div align="left">Inner Dia2:</div></td>
  51.                   <td width="150" align="Center" valign="Center"><div align="left"><input name="toc_to" type="text" size="25" style="width:194px; height:17px; font-size:11px; font-family:tahoma; border-style:solid; border-width:1px; border-color:#4C4A48; color:#8C8B89; background-color:#0A0501 "></div></td>
  52.               </tr>
  53.               <tr>
  54.                   <td class="add"><div align="left">Product:</div></td>
  55.                   <td width="150" align="Center" valign="Center"><div align="left"><input name="cust_add" type="text" size="25" style=" width:194px; height:17px; font-size:11px; font-family:tahoma; border-style:solid; border-width:1px; border-color:#8C8B89; color:#8C8B89; background-color:#0A0501 "></div></td>
  56.                   <td class="add"><div align="left">Unit Price:</div></td>
  57.                   <td width="150" align="Center"><div align="left"><input name="tel_no" type="text" size="25" style="width:194px; height:17px; font-size:11px; font-family:tahoma; border-style:solid; border-width:1px; border-color:#4C4A48; color:#8C8B89; background-color:#0A0501 "></div></td>
  58.               </tr>
  59.           </table>   
  60.           </td>
  61.       </tr>
Nov 22 '07 #1
10 1754
drhowarddrfine
7,435 Recognized Expert Expert
This is a javascript question and I am transferring it there. However, I was tempted to delete this whole thing because I cannot take the time to try and figure out what you are saying. While I understand English may not be your primary language, your shorthand words suggest otherwise and I wouldn't be surprised if the javascript folks close this out. I suggest you edit this and make it more readable before they do.

And now I screwed up the listing for the code so you will have to repost that, too.
Nov 22 '07 #2
omerbutt
638 Contributor
hi there i am working on an inventory project (platform ,HTML,JAVASCRIP T,ASP)and for that i have made a stock entry form which is pasted below,I have included this form in the main Add Stock.asp page, having the following inputs to be saved

1.code no
2.part no
3.total replace no's--------->this is wot the ques is about
4.auto
5.type
6.brand
7.height
8.product
9.outer dia 1
10. outer dia2
11.inner dia1
12.inner dia 2
13unit price

Now the client has the business of AUTO FILTERS ,now for each Filter they have different qualities for which they Reprsent a "Replacemen t No" means for example if he has Mobile of Nokia6230 in 3 Manufacturers andhe has 2pieces of each, i.e "uk made"=2, "china made"=2, "hungary made"=2 e.t.c he will assign 1 "Code No" the Hungary Made mobile and for the other 2 mobiles he will assign 2 "Replace Nos" in the same Entry, now the prob is that the total number of "Replace Nos" are not fixed there can be 1 "Replace No" for 1 product and on the other hand 5 "Rep Nos " for another product ,what i am doing/trying to do is that i am using a div with a selection menu in which i want to give a serial of numbers from 1 to onwards and i am using the "onchange" in the "Select" tag which is calling a javascript function which enables the other divs for eg if i have selected "3" in the "Total Replace Nos" option then it shud call the javascript function which shud enable 3 input boxes to enter the 3 replace nos for the part :( isnt it lengthy ...if there is a better way todo this thing do temme and thanks for any help in advance, the code for the form is given here :
Expand|Select|Wrap|Line Numbers
  1. <tr>
  2.  <td>
  3. <table cellspacing="0" cellpadding="0" width="690" align="center" valign="top" bordercolor="#4C4A48" height="170">
  4.  
  5. <tr><td class="add"><div align="left">Code No:</div></td>
  6.      <td width="150" align="Center" valign="Center"><div align="left"><input name="code_no" type="text" size="25" style="width:194px; height:17px; font-size:11px; font-family:tahoma; border-style:solid; border-width:1px; border-color:#4C4A48; color:#8C8B89; background-color:#0A0501 "></div></td>
  7.             <td class="add"><div align="left">Part No:</div></td>
  8.             <td width="150" align="Center" valign="Center"><div align="left"><input name="cust_name" type="text" size="25" style="width:194px; height:17px; font-size:11px; font-family:tahoma; border-style:solid; border-width:1px; border-color:#4C4A48; color:#8C8B89; background-color:#0A0501 "></div></td>
  9.         </tr>
  10.         <tr>            
  11.             <td class="add"><div align="left">Total Replace No's:</div></td>
  12.             <td class="150" align="center" valign="middle">
  13.             <div align="left">
  14.             <SELECT name="t_rep" onChange="" style=" width:194px; height:17px; font-size:11px; font-family:tahoma; border-style:solid; border-width:1px; border-color:#8C8B89; color:#8C8B89; background-color:#0A0501 ">
  15.                 <OPTION value="none" selected="selected">Please Select Any Number</OPTION>
  16.                 <option value="1">1</option>
  17.                 <option value="2">2</option>
  18.                 <option value="3">3</option>
  19.                 <option value="4">4</option>
  20.             </select>
  21.             </div>
  22.             </td>
  23.             <td class="add"><div align="left">Auto:</div></td>
  24.             <td width="150" align="Center" valign="Center"><div align="left"><input name="cust_add" type="text" size="25" style="width:194px; height:17px; font-size:11px; font-family:tahoma; border-style:solid; border-width:1px; border-color:#4C4A48; color:#8C8B89; background-color:#0A0501 "></div></td>
  25.         </tr>
  26.         <tr>
  27.             <td class="add"><div align="left">Replace No:</div></td>
  28.             <td width="150" align="Center" valign="Center"><div align="left"><input name="cust_add" type="text" size="25" style=" width:194px; height:17px; font-size:11px; font-family:tahoma; border-style:solid; border-width:1px; border-color:#8C8B89; color:#8C8B89; background-color:#0A0501 "></div></td>
  29.             <td class="add"><div align="left">Outer Dia1:</div></td>
  30.             <td width="150" align="Center" valign="Center"><div align="left"><input name="toc_fr" type="text" size="25" style="width:194px; height:17px; font-size:11px; font-family:tahoma; border-style:solid; border-width:1px; border-color:#4C4A48; color:#8C8B89; background-color:#0A0501 "></div></td>
  31.         </tr>
  32.         <tr>
  33.             <td class="add"><div align="left">Type:</div></td>
  34.             <td width="150" align="Center" valign="Center"><div align="left"><input name="cust_add" type="text" size="25" style="width:194px; height:17px; font-size:11px; font-family:tahoma; border-style:solid; border-width:1px; border-color:#4C4A48; color:#8C8B89; background-color:#0A0501 "></div></td>
  35.             <td class="add"><div align="left">Outer Dia2:</div></td>
  36.             <td width="150" align="Center" valign="Center"><div align="left"><input name="toc_fr" type="text" size="25" style="width:194px; height:17px; font-size:11px; font-family:tahoma; border-style:solid; border-width:1px; border-color:#4C4A48; color:#8C8B89; background-color:#0A0501 "></div></td>
  37.         </tr>                                            
  38.         <tr>
  39.             <td class="add"><div align="left">Brand:</div></td>
  40.             <td ="#346598" width="150" align="Center" valign="Center"><div align="left"><input name="caller" type="text" size="25" style="width:194px; height:17px; font-size:11px; font-family:tahoma; border-style:solid; border-width:1px; border-color:#4C4A48; color:#8C8B89; background-color:#0A0501 "></div></td>
  41.             <td class="add"><div align="left">Inner Dia1:</div></td>
  42.             <td width="150" align="Center" valign="Center"><div align="left"><input name="toc_to" type="text" size="25" style="width:194px; height:17px; font-size:11px; font-family:tahoma; border-style:solid; border-width:1px; border-color:#4C4A48; color:#8C8B89; background-color:#0A0501 "></div></td>
  43.         </tr>
  44.         <tr>
  45.             <td class="add"><div align="left">Height:</div></td>
  46.             <td ="#346598" width="150" align="Center" valign="Center"><div align="left"><input name="caller" type="text" size="25" style="width:194px; height:17px; font-size:11px; font-family:tahoma; border-style:solid; border-width:1px; border-color:#4C4A48; color:#8C8B89; background-color:#0A0501 "></div></td>
  47.             <td class="add"><div align="left">Inner Dia2:</div></td>
  48.             <td width="150" align="Center" valign="Center"><div align="left"><input name="toc_to" type="text" size="25" style="width:194px; height:17px; font-size:11px; font-family:tahoma; border-style:solid; border-width:1px; border-color:#4C4A48; color:#8C8B89; background-color:#0A0501 "></div></td>
  49.         </tr>
  50.         <tr>
  51.             <td class="add"><div align="left">Product:</div></td>
  52.             <td width="150" align="Center" valign="Center"><div align="left"><input name="cust_add" type="text" size="25" style=" width:194px; height:17px; font-size:11px; font-family:tahoma; border-style:solid; border-width:1px; border-color:#8C8B89; color:#8C8B89; background-color:#0A0501 "></div></td>
  53.             <td class="add"><div align="left">Unit Price:</div></td>
  54.             <td width="150" align="Center"><div align="left"><input name="tel_no" type="text" size="25" style="width:194px; height:17px; font-size:11px; font-family:tahoma; border-style:solid; border-width:1px; border-color:#4C4A48; color:#8C8B89; background-color:#0A0501 "></div></td>
  55.         </tr>
  56.     </table>    
  57.     </td>
  58. </tr>
  59.  
  60.  
Nov 22 '07 #3
acoder
16,027 Recognized Expert Moderator MVP
You're not calling any function onchange.

Where's the JavaScript code or have you not written any yet?

Could you explain a little more what exactly needs adding?
Nov 22 '07 #4
acoder
16,027 Recognized Expert Moderator MVP
I've merged the two threads - your thread was already moved here.
Nov 22 '07 #5
omerbutt
638 Contributor
You're not calling any function onchange.

Where's the JavaScript code or have you not written any yet?

Could you explain a little more what exactly needs adding?

okay,.......... ......i am rewriting the code and have just inclued the part in which i need the help okay below isteh code u can copy paste and run ........what this code has is it has a Dropdown Selection Box with a name of
"TOTAL REP NOS"in which we have 2 options
namely "1 replace no", "2 replace nos"
if we select "1 replace no" then it will enable the div named "rep_no_1"
and if we select "2 replace nos" then it will enable div named "rep_no_2" along with the "rep_no_1" ,,,,,,......... ....now in this code the selection box has only 2 options i want those options to be unlimited means like this
{1 rep no ,2 rep no,3 rep nos and so on}.....means it shud not be hard coded

NO 2

it shud generate the input boxes according to the selected option in the
"Total rep nos".......wha t i have done is i have created those 2 input boxes named as "rep no 1" & "rep no 2" and have hidden it through a javascript funtion named "HideDiv()" , which i am calling in the<body onload="Hidediv ();"> which uses an 'inline' code and hides those input fields ........whereas i donot want to do this because the client can have any number of "Rep nos" ....i hope u get the rest when ou will see and run the code ,,,,,,,,,,,,,,, ,thanks in advance 4 any help
Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4.     <title>Add New Stock</title>
  5. <link rel="stylesheet" href="home.css" />
  6. <link rel="stylesheet" type="text/css" href="cssverticalmenu.css" />
  7. <link rel="stylesheet" type="text/css" href="Stk_frm.css" />
  8. <script type="text/javascript" language="javascript">
  9.         function HideDiv()
  10.         {
  11.             eval("document.all.lable_rep_no1.style.display = 'none';");
  12.             eval("document.all.div_rep_no1.style.display = 'none';");
  13.             eval("document.all.lable_rep_no2.style.display = 'none';");
  14.             eval("document.all.div_rep_no2.style.display = 'none';");            
  15.         }
  16.         function enablediv()
  17.         {
  18.             if((document.all.t_rep.value)=="a")
  19.             {
  20.                 HideDiv();
  21.                 eval("document.all.lable_rep_no1.style.display = 'inline';");
  22.                 eval("document.all.div_rep_no1.style.display = 'inline';");                
  23.             }
  24.             else if((document.all.t_rep.value)=="b")
  25.             {
  26.                 HideDiv();
  27.                 eval("document.all.lable_rep_no1.style.display = 'inline';");
  28.                 eval("document.all.div_rep_no1.style.display = 'inline';");    
  29.                 eval("document.all.lable_rep_no2.style.display = 'inline';");
  30.                 eval("document.all.div_rep_no2.style.display = 'inline';");
  31.             }
  32.             else
  33.             {
  34.                 HideDiv();
  35.             }
  36.         }
  37. </script>
  38. </head>
  39. <body bgcolor="#1D1710" onload="HideDiv(); document.stkfrm.code_no.focus();">
  40. <form name="stkfrm" method="post">
  41. <table width="100%">
  42. <div class="content" align="center">
  43.     <div id="top">    
  44.         <h1>FILTERS INVENTORY SYSTEM</h1>
  45.         <h2>STOCK ENTRY FORM</h2>
  46.     </div>
  47. </div>
  48.  
  49. <table align="left" cellpadding="0" cellspacing="0" width="190" bgcolor="#0A0501">
  50. </table>    
  51.     <tr>
  52. <tr>
  53.     <div class="h1" align="left">
  54.         <div id="top2" align="left">
  55.             <h3>Add New Stock Item</h3>
  56.         </div>
  57.     </div>
  58. </tr>
  59. <tr>
  60. <td>
  61. <table align="center" cellpadding="0" cellspacing="0" width="700" bgcolor="#0A0501" bordercolor="4C4A48">
  62.     <tr>
  63.         <td><br>
  64.             <tr>            
  65.             <td class="add"><div align="left"><font face="Verdana, Arial, Helvetica, sans-serif" color="#FFFFFF">Total Replace No's:</font></div></td>
  66.             <td class="150" align="center" valign="middle">
  67.             <div align="left">
  68.             <SELECT name="t_rep" onChange="enablediv();" style=" width:194px; height:17px; font-size:11px; font-family:tahoma; border-style:solid; border-width:1px; border-color:#8C8B89; color:#8C8B89; background-color:#0A0501 ">
  69.                 <OPTION value="none" selected="selected">Please Select Any Number</OPTION>
  70.                 <option value="a">1 Rep No</option>
  71.                 <option value="b">2 Rep Nos</option>
  72.             </select>
  73.             </div>
  74.             </td>
  75.         </tr>
  76.         <tr>
  77.             <td class="add"><div align="left" id="lable_rep_no1"><font face="Verdana, Arial, Helvetica, sans-serif" color="#FFFFFF">Rep no1:</font></div></td>
  78.             <td width="150" align="Center" valign="Center"><div align="left" id="div_rep_no1"><input name="rep_no1" type="text" size="25" style="width:194px; height:17px; font-size:11px; font-family:tahoma; border-style:solid; border-width:1px; border-color:#4C4A48; color:#8C8B89; background-color:#0A0501 "></div></td>
  79.         </tr>
  80.         <tr>
  81.             <td class="add"><div align="left" id="lable_rep_no2"><font face="Verdana, Arial, Helvetica, sans-serif" color="#FFFFFF">Rep no2:</font></div></td>
  82.             <td width="150" align="Center" valign="Center"><div align="left" id="div_rep_no2"><input name="rep_no2" type="text" size="25" style="width:194px; height:17px; font-size:11px; font-family:tahoma; border-style:solid; border-width:1px; border-color:#4C4A48; color:#8C8B89; background-color:#0A0501 "></div></td>
  83.         </tr>
  84.             </td>
  85.         </tr>
  86.     </tr>
  87.     <tr>
  88.     <td>
  89.  
  90.     </td>
  91.     </tr>
  92.     <tr>
  93.     <td>
  94.     <table align="right" cellpadding="0" cellspacing="0" width="50%" border="1" bordercolor="#0A0501">
  95.         <td align="center" ><input name="" type="image" src="images/submit.jpg" align="absmiddle" style="margin-left:80px" onclick="javascript:return val_log();"></td>
  96.         <td align="left" ><input name="" type="image" src="images/reset.jpg" align="absmiddle" style="margin-left:0px" onclick="javascript:return canc();"></td>
  97.      </table>
  98.     </td>
  99.     </tr>
  100.     <tr>
  101.     <td>
  102.  
  103.     </td>
  104.     </tr>
  105. </table>
  106. </td>
  107. </tr>
  108.     </tr>
  109. </table>
  110. </form>
  111. </body>
  112. </html>
  113.  
Nov 22 '07 #6
acoder
16,027 Recognized Expert Moderator MVP
When you say you don't want it hard-coded, how are you going to decide how many? Is this determined from the server-side code?

Note 1: don't use document.all. Use document.getEle mentById instead - you will need to give your elements ids.

Note 2: there's no need to use eval. Remove eval and the JavaScript statements should be executed.
Nov 22 '07 #7
omerbutt
638 Contributor
When you say you don't want it hard-coded, how are you going to decide how many? Is this determined from the server-side code?

Note 1: don't use document.all. Use document.getEle mentById instead - you will need to give your elements ids.

Note 2: there's no need to use eval. Remove eval and the JavaScript statements should be executed.
that isw the problem i t could be any number that the user decides can be 4 replace no for a product and can be 1 replace number :( i am rally stucked in it
..........sir if u have any other way to do this lemme know and i am a new bee to javascript i am not that much expert at it and i havent used that document.getEle mentById....can u give me some helping code or ereeference through which i can have an idea that what i have to do
Nov 22 '07 #8
acoder
16,027 Recognized Expert Moderator MVP
that isw the problem i t could be any number that the user decides can be 4 replace no for a product and can be 1 replace number :( i am rally stucked in it
..........sir if u have any other way to do this lemme know and i am a new bee to javascript i am not that much expert at it and i havent used that document.getEle mentById....can u give me some helping code or ereeference through which i can have an idea that what i have to do
You will have to dynamically create elements or, if you have a maximum, you could hide them all and display the ones required.

What if someone wants more than the number you have in the select element? You would need to let them enter a number in a text field and then parse it to get the number and display that number of divs/input text boxes.

For document.getEle mentById(), see this link.
Nov 22 '07 #9
omerbutt
638 Contributor
hi i am trying to make an input box that shud take a numeric input and then display that number of input boxes under it,for e.g a user enters 4 in the input box then there should be 4 input boxes appearing under it, what i have done in my code is here, my current code is for 2 input boxes but it is not working
Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3. <script type="javascript">
  4. function HideDiv()
  5. {
  6.     eval("document.all.lable_rep_no1.style.display = 'none';");
  7.     eval("document.all.div_rep_no1.style.display = 'none';");
  8.     eval("document.all.lable_rep_no2.style.display = 'none';");
  9.     eval("document.all.div_rep_no2.style.display = 'none';");        
  10. }
  11.  
  12. function enablediv()
  13. {
  14.     var Count;
  15.     Count = document.getElementById('t_rep');
  16.     if((Count)=="1")
  17.     {
  18.     HideDiv();
  19.     eval("document.all.lable_rep_no1.style.display = 'inline';");
  20.     eval("document.all.div_rep_no1.style.display = 'inline';");
  21.     }
  22.     else if((Count)=="2")
  23.     {
  24.     HideDiv();
  25.     eval("document.all.lable_rep_no1.style.display = 'inline';");
  26.     eval("document.all.div_rep_no1.style.display = 'inline';");    
  27.     eval("document.all.lable_rep_no2.style.display = 'inline';");
  28.     eval("document.all.div_rep_no2.style.display = 'inline';");
  29.     }
  30.     else
  31.     {
  32.     HideDiv();
  33.     }
  34. }
  35. </script>
  36. </head>
  37. <body bgcolor="#1D1710" onload="HideDiv(); document.stkfrm.t_rep.focus();">
  38. <form name="stkfrm" method="post">
  39. <table width="100%">
  40. <div class="content" align="center">
  41.     <div id="top">    
  42.         <h1>FILTERS INVENTORY SYSTEM</h1>
  43.         <h2>STOCK ENTRY FORM</h2>
  44.     </div>
  45. </div>
  46.  
  47. <table align="left" cellpadding="0" cellspacing="0" width="190" bgcolor="#0A0501">
  48. </table>    
  49.     <tr>
  50. <tr>
  51.     <div class="h1" align="left">
  52.         <div id="top2" align="left">
  53.             <h3>Add New Stock Item</h3>
  54.         </div>
  55.     </div>
  56. </tr>
  57.  
  58. <table align="center" cellpadding="0" cellspacing="0" width="700" bgcolor="#0A0501" bordercolor="4C4A48">
  59. <tr>
  60.     <td>
  61.         <tr>            
  62.             <td class="add"><div align="left"><font face="Verdana, Arial, Helvetica, sans-serif" color="#FFFFFF">Total Replace No's:</font></div></td>
  63.             <td class="150" align="center" valign="middle"><div align="left"><input onkeypress="enablediv();" id="t_rep" type="text" style=" width:194px; height:17px; font-size:11px; font-family:tahoma; border-style:solid; border-width:1px; border-color:#8C8B89; color:#8C8B89; background-color:#0A0501 "></div>
  64.             </td>
  65.         </tr>
  66.         <tr>
  67.             <td class="add"><div align="left" id="lable_rep_no1"><font face="Verdana, Arial, Helvetica, sans-serif" color="#FFFFFF">Rep no1:</font></div></td>
  68.             <td width="150" align="Center" valign="Center"><div align="left" id="div_rep_no1"><input name="rep_no1" type="text" size="25" style="width:194px; height:17px; font-size:11px; font-family:tahoma; border-style:solid; border-width:1px; border-color:#4C4A48; color:#8C8B89; background-color:#0A0501 "></div></td>
  69.         </tr>
  70.         <tr>
  71.             <td class="add"><div align="left" id="lable_rep_no2"><font face="Verdana, Arial, Helvetica, sans-serif" color="#FFFFFF">Rep no2:</font></div></td>
  72.             <td width="150" align="Center" valign="Center"><div align="left" id="div_rep_no2"><input name="rep_no2" type="text" size="25" style="width:194px; height:17px; font-size:11px; font-family:tahoma; border-style:solid; border-width:1px; border-color:#4C4A48; color:#8C8B89; background-color:#0A0501 "></div></td>
  73.         </tr>
  74.     </td>
  75. <tr>
  76.     <td>
  77.     <table align="right" cellpadding="0" cellspacing="0" width="50%" border="1" bordercolor="#0A0501">
  78.         <td align="center" ><input name="" type="image" src="images/submit.jpg" align="absmiddle" style="margin-left:80px" onclick=""></td>
  79.         <td align="left" ><input name="" type="image" src="images/reset.jpg" align="absmiddle" style="margin-left:0px" onclick=""></td>
  80.      </table>
  81.     </td>
  82.     </tr>
  83.     <tr>
  84.     <td>
  85.  
  86.     </td>
  87.     </tr>
  88. </table>
  89. </td>
  90. </tr>
  91.     </tr>
  92. </table>
  93. </form>
  94. </body>
  95. </html>
  96.  
Nov 23 '07 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

2
1977
by: Joey | last post by:
Say a customer inserts into a sql database field (NUMINSERTS) the number 6. On the following page, I want to build a table that displays 6 input boxes, since the customer said they wanted 6 text boxes. I will then insert the data from the 6 text boxes back into another sql database table. For example:
2
3074
by: reneeccwest | last post by:
Different user input boxes are automatically populated based on a value of the dropdown box. Can anyone help me on that?
3
5178
by: KathyB | last post by:
Hi, I'm trying to find a way to validate input text boxes where I don't know the names until the page is rendered. I've got 2 validate functions that fire with the onsubmit button of a "mini" form within the html document. When the Finish button is clicked, I need to check for any empty input boxes before loading the next aspx page...but it could be no boxes or five boxes, etc.? I've included my html output...if you have any ideas,...
3
4956
by: Lozette | last post by:
Hi all, I'm wondering if anyone else has noticed some odd behavious with IE6.0 colouring input boxes yellow (or any other colour!) unexpectedly? I am using IE6.0.2 on WinXP Pro. I had a bug report from my boss and some clients, complaining that they were seeing yellow text input boxes on our site (when the boxes *should* be styled grey with CSS). After some investigation I found
2
4732
by: Shabam | last post by:
I was told that dotnet generates classes for input tags like this: <span class="hello"><input type= "checkbox"></span> The problem here is, the "input" class is overriding the "hello" class. Ideally I wanted the html to be this way: <input type= "checkbox" class="hello"> However since dotnet insists on doing it the first way, it's not working for
5
15124
by: Nathan Bloom | last post by:
Hi, I have a secured database that runs fine on the computer the database is installed on. I have several workstations with access runtime installed that also need access to the database. Access runtime runs fine when accessing an unsecured version of the database. However once the database was secured it generates a runtime error after asking for the user and password and won't open. The shortcut to the secured database is: "path...
5
33092
by: kildareguy | last post by:
I am getting this error when running a module in Access 2002...anyone know what it is? and how to correct it?
3
2466
by: Rameshika | last post by:
Hi All How can I select a particular row in a datagrid.Where when the user double clicks the data in that row should appear in the corresponding text boxes in runtime And how can the user insert,delete and edit fields in a datagrid at runtime Please be kind enough to help me Thanks Rameshika
13
3030
by: amykimber | last post by:
Hi all, I know I'm doign something really daft, but I can't get this to work... I have a form with a bunch of inputs called ship_owner - why the ? Because I'm submitting this page though php and the put the data into an array in the post.... anywhat. I have a link <a href="javascript:change_class()" >Block mode</a> to
0
9645
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10329
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9950
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8974
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6740
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5381
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3650
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2880
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.