Microsoft
Software
Hardware
Network
Question : javascript
Hello i have 5 textbox with the same name , the only thing that change is the number at the end of the name
let say:
document.Invoice.txtName1.
value
document.Invoice.txtName2.
value
document.Invoice.txtName3.
value
how can i just change the number for a variable:
something like
var x = 1;
document.Invoice.txtName(x
).value
document.Invoice.txtName(x
).value
document.Invoice.txtName(x
).value
so i can run a for 3 times and don,t have to write all the code for each field.
Answer : javascript
use the id attribute for this
<input type="text" id='txt1'>
<input type="text" id='txt2'>
<input type="text" id='txt3'>
for ( var counter = 1; counter <= 3; counter++ )
{
alert(document.getElementB
yId("txt" + counter ).value);
}
Random Solutions
Transfer DB from SQL 2000 on one server to SQL 2008 on another server
PSTN Signaling
VNC: Seeing main screen on computer:0
migrated to windows2008 sbs from 2003 sbs, need to know where to place batch/script files at
Exchange Mailbox behaviour on Disabled accounts
.net create thumbnail for pdf
I have a switch statement to compare a datagrid column type to a constant. How do I assign a DateTime type to a constant. I tried using type of but that is run time
Can you subnet 1 public address or only a Class A, B or C network?
Compaq EVO W6000 - 4GB RAM?
APC Smart-up 1500 XLM