![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Hta how acces many text box in vbscript Hi, I got an hta with a lot of text box. How can I access the information of the text box in vbscript without calling them by their name? All the example I found use the method var = inputObjectName.value But I can’t, I have a table of 15 rows with 3 text box by row! I would like to use a loop to create the name of the input fields. Let’s built an example: <script language="VBScript"> Sub run […] for i=1 to 5 strA = ("A"&i).value strB = (“B"&i).value strC = ("C"&i).value strLine = strA.value & "*" & strB.value & "*" & strC.value msgbox strLine Next […] End Sub </script> <script language="VBScript"> […] <tr> <td><input type="text" name="A1" size="100"></td> <td><input type="text" name="B1" size="8"></td> <td><input type="text" name="C1" size="8"></td> </tr> <tr> <td><input type="text" name="A2" size="100"></td> <td><input type="text" name="B2" size="8"></td> <td><input type="text" name="C3" size="8"></td> </tr> […] <p><input type="button" value="Run" name="run" onClick="run" class="save"></p> […] </body> I try many solution but my proble is around this line; strC = ("C"&i).value It fail cause ("C"&i) is not an object. How can I fix that. Any suggestion would be welcome ![]() |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Hta how acces many text box in vbscript On Dec 8, 2:19*pm, Pat <P...@xxxxxx> wrote: Quote: > Hi, > > I got an hta with a lot of text box. How can I access the information of the > text box in vbscript without calling them by their name? > All the example I found use the method var = inputObjectName.value > But I can’t, I have a table of 15 rows with 3 text box by row! > > I would like to use a loop to create the name of the input fields. Let’s > built an example: * > > <script language="VBScript"> > Sub run > *[…] > * *for i=1 to 5 > * * * strA = ("A"&i).value > * * * strB = (“B"&i).value > * * * strC = ("C"&i).value > * * * strLine = *strA.value & "*" & strB.value & "*" & strC.value > * * * msgbox strLine > * *Next > […] > End Sub > </script> > > <script language="VBScript"> > * * […] > <tr> > * *<td><input type="text" name="A1" size="100"></td> > * *<td><input type="text" name="B1" size="8"></td> > * *<td><input type="text" name="C1" size="8"></td> > </tr> > <tr> > * *<td><input type="text" name="A2" size="100"></td> > * *<td><input type="text" name="B2" size="8"></td> > * *<td><input type="text" name="C3" size="8"></td> > </tr> > […] > <p><input type="button" value="Run" name="run" onClick="run" class="save"></p> > […] > </body> > > I try many solution but my proble is around this line; *strC = ("C"&i).value > It fail cause ("C"&i) is not an object. How can I fix that. > > Any suggestion would be welcome ![]() for i=1 to 5 strA = Eval("A" & i & ".value") strB = Eval("B" & i & ".value") strC = Eval("C" & i & ".value") strLine = strA & "*" & strB & "*" & strC msgbox strLine next Tom Lavedas *********** http://there.is.no.more/tglbatch/ |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Hta how acces many text box in vbscript You can use an index: <td><input type="text" ID="A" size="100"></td> <td><input type="text" ID="B" size="8"></td> <td><input type="text" ID="C" size="8"></td> <td><input type="text" ID="A" size="100"></td> <td><input type="text" ID="B" size="8"></td> <td><input type="text" ID="C" size="8"></td> <td><input type="text" ID="A" size="100"></td> <td><input type="text" ID="B" size="8"></td> <td><input type="text" ID="C" size="8"></td> '-- return the content of all textboxes with ID of "A". strline = a(0).value & A(1).value & A92).value |
My System Specs![]() |
| | #4 (permalink) |
| | Re: Hta how acces many text box in vbscript Hi mayayana, I don't try it for this hta but I keep it in mind for my next script. Thanks for your answer. Quote: > strline = A(0).value & A(1).value & A(92).value |
My System Specs![]() |
| | #5 (permalink) |
| | Re: Hta how acces many text box in vbscript Nice I try it for fun. It work, very interesting, first time I saw it this way! Pat |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Acces right with WMI Method | PowerShell | |||
| How to remove vbscript text from message box | VB Script | |||
| Past vbscript input box text to the end of url | VB Script | |||
| How to do No hang up VBScript (nohup for VBScript) | VB Script | |||
| Cannot acces Vista from XP | Vista networking & sharing | |||