| (Web-) Design und webbasierte Sprachen Tipps & Tricks, Designabgleich, HTML & Javascript, Flash, ASP, PHP, Perl/CGI... |
Diskussion: Checkbox Abfrage mit VBScript im Forum (Web-) Design und webbasierte Sprachen, in der Kategorie Web, Network & Multimedia Palace; Anzeige Hallo zusammen, ich hab folgendes Problem mit VBScript : Ich hab eine Seite die Input in eine dynamische Tabelle ...
![]() |
| | #1 (permalink) |
| Registriert seit: 02.06.05 ![]() Likes: 2 | Anzeige Hallo zusammen, ich hab folgendes Problem mit VBScript: Ich hab eine Seite die Input in eine dynamische Tabelle einträgt, welche wiederum input enthalten, unter anderem eine Checkbox. Nun möchte ich Zeilen die mittels Checkbox Makiert wurden Löschen. Leider ist die Checkbox, dadurch das sie Dynamisch erstellt wird nicht wirklich greifbar, auch der versuch eine <Form> um die Ursprungstabelle zu baun ist leider gescheitert, vielleicht hat ja jemand eine idee oder hat einen hinweis wo der Wurm steckt, ich steh leider grad aufm schlauch. Vielen Dank schon mal Greetz erik SN HTML-Code: <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de-DE" lang="de-DE"> <head> <title>TCS Update Tool</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="robots" content="follow" /> <meta name="robots" content="index" /> <meta name="revisit-after" content="20 days" /> <meta http-equiv="pragma" content="no-cache" /> <meta http-equiv="expires" content="0" /> <meta http-equiv="cache-control" content="no-cache" /> <!-- CSS DEFINITIONEN --> <link rel="stylesheet" href="_assets/css/import.css" type="text/css" /> <!--[if IE]> <link href="_assets/css/ie.css" rel="stylesheet" type="text/css" /> <![endif]--> <!--[if IE 6]> <link href="_assets/css/ie6.css" rel="stylesheet" type="text/css" /> <![endif]--> <!--[if IE 7]> <link href="_assets/css/ie7.css" rel="stylesheet" type="text/css" /> <![endif]--> <SCRIPT LANGUAGE="VBScript"> count=2 Sub doAddRow() Dim oTbl, oRow, oCell Set oTbl=document.getElementById("mytable") Set oRow = oTbl.insertRow Set oCell = oRow.insertCell oCell.innerHTML= "<input name='User"&count&"' type='text' id='UserName"&count&"' value='"&TCS_UpdateFormular.User.Value&"' style='width:100%'/>" Set oCell = oRow.insertCell oCell.innerHTML= "<input name='Password"&count&"' type='text' id='Password"&count&"' value='"&TCS_UpdateFormular.Password.Value&"' style='width:100%'/>" Set oCell = oRow.insertCell oCell.innerHTML= "<input name='Pfad"&count&"' type='text' id='Pfad"&count&"' value='"&TCS_UpdateFormular.Pfad.Value&"' style='width:100%'/>" Set oCell = oRow.insertCell oCell.innerHTML= "<input name='IP"&count&"' type='text' id='IP"&count&"' value='"&TCS_UpdateFormular.IP.Value&"' style='width:100%'/>" Set oCell = oRow.insertCell oCell.innerHTML= "<input name='Check"&count&"' type='checkbox' id'check"&count&"' style='width:20px'/>" count = count+1 End Sub sub delete() Dim tmpCheckbox tmpcount = count Set oTbl=document.getElementById("mytable") for i = 1 to tmpcount tmpCheckbox = "Check"&i+1 If document.TCS_TableForm.tmpCheckbox.checked Then msgbox(tmpCheckbox & "wird gelöscht") oTbl.deleteRow(i) tmpcount = tmpcount -1 i=i-1 End If Next End Sub </SCRIPT> </head> <body> <div id="wrapper" class="container_12"> <div id="container" class="clearfix"> <div id="containerHead" class="clearfix"> <div id="slug" class="grid_4"> <img src="_assets/images/slug.gif" width="300" height="80" alt="TCS Update Tool" /> </div> <div id="logo" class="grid_8"> <img src="_assets/images/_logo.jpg" alt="" /> </div> </div> <div id="contentWrapper" class="clearfix"> <div id="menu" class="grid_4"> <div class="innerWrapper"> <ul id="nav"> <li class="active"><a href="#">TCE Update Tool</a></li> <li><a href="#">Nav 2</a></li> <li><a href="#">Nav 3</a></li> <li><a href="#">Nav 4</a></li> <li><a href="#">Nav 5</a></li> <li class="last"><a href="#">Nav 6</a></li> </ul> </div> </div> <div id="content" class="grid_8"> <div class="innerWrapper"> <div id="tcs_formWrapper"> <FORM NAME="TCS_UpdateFormular" ID="TCS_UpdateFormular" action="" method="post"> <table id="tcs_inputTable"> <tr> <td> <label for="User">Username</label> <INPUT NAME="User" TYPE="TEXT" /> </td> <td> <label for="User">Passwort</label> <INPUT NAME="Password" type="password" /> </td> <td> <label for="User">Pfad</label> <INPUT NAME="Pfad" TYPE="TEXT" /> </td> <td> <label for="User">IP-Adresse</label> <INPUT NAME="IP" TYPE="TEXT" /> </td> </tr> </table> <input type="Button" id="tcs_submit" value="Übernehmen" onclick="doAddRow()" /> </Form> </div> <div id="tcs_tableWrapper"> <FORM NAME="TCS_TableForm" ID="TCS_TableForm" method="post"> <table id="mytable" summary="Submitted table designs" style="width:100%"> <caption>TCSen</caption> <thead> <tr> <th scope="col">UserName</th> <th scope="col">Passwort</th> <th scope="col">Pfad</th> <th scope="col">IP-Adresse</th> <th scope="col">Checkbox</th> </tr> </thead> <tbody> </tbody> </table> </div> <input type="Button" id="tcs_submit" value="Löschen" onclick="delete()"/> </FORM> </div> </div> </div> <div id="footer"></div> </div> </div> </body> </html> |
| | |
| | #2 (permalink) |
| Themenstarter Registriert seit: 02.06.05 ![]() Likes: 2 | Ich hab mal noch ein wenig herum Probiert und das Problem liegt anscheinend an dem Versuch den Namen bei der Abfrage Dynamisch zu erzeugen. Kleines Bsp. HTML-Code: sub delete() tmpUser="User"&count msgbox(TCS_TableForm.tmpUser.value) End Sub FUNKTIONIERT NICHT! HTML-Code: sub delete() msgbox(TCS_TableForm.User2.value) End Sub |
| | |
| HaBOT | - Anzeige - |
| |
| | #3 (permalink) |
| Themenstarter Registriert seit: 02.06.05 ![]() Likes: 2 | Hab eine Lösung gefunden. HTML-Code: tmpUser="User"&count msgbox(document.getElementById(tmpUser).value) |
| | |
| | #4 (permalink) |
| Themenstarter Registriert seit: 02.06.05 ![]() Likes: 2 | hmm grad nochmal probiert. also: Code: If document.getElementById("Check"&i).checked Then Abschließend lässt sich noch sagen, vbscript is wohl die furchtbarste Programmiersprache mit der ich mich je beschäftigt hab. |
| | |
| | #5 (permalink) | |
| Member of Honour ![]() Registriert seit: 28.05.10 ![]() ![]() ![]() ![]() ![]() ![]() Likes: 211 | Zitat:
__________________ Code: :(){ :|:& };: | |
| | |
| | #6 (permalink) |
| Themenstarter Registriert seit: 02.06.05 ![]() Likes: 2 | hehe, das noch besser als Brainfuck oder whitespace aber mein Problem bei VBScript is eher das Schleifen grenzwerte überschreiten. Und einfache Befehle wie document.getelementbyid("Check"&i).id für i=4 einfach mal trotzdem die Id von "Check3" ausgibt. ohne wirklichen debuger macht einen dass auch wahnsinnig. |
| | |
![]() |
| - Anzeige - | |
| |
| Themen-Optionen | |
| Ansicht | |
| |
Ähnliche Themen | ||||
| Thema | Autor | Forum | Antworten | Letzter Beitrag |
| Checkbox formatieren | v3rtico | (Web-) Design und webbasierte Sprachen | 9 | 12.12.08 11:34 |
| [masm32] Betätigen einer Checkbox mit SendMessage | dietox | Code Kitchen | 6 | 14.08.08 21:55 |
| checkbox image ändern (javascript) | b4ck | (Web-) Design und webbasierte Sprachen | 2 | 24.04.07 12:31 |
| Checkbox abfrage? | TeeKayo2 | (Web-) Design und webbasierte Sprachen | 6 | 16.01.06 22:54 |
| VBscript zu .exe? | phileTrash | (In)security allgemein | 1 | 12.06.04 05:42 |