Oppure

Loading
27/04/10 19:57
salva94
Ragazzi ho visto molte guide in questi giorni di come ottenere un Id di un bottone e come accedere, ma vorrei capire come modificare il vaolore di una textbox in una pagina web, esempio :
<form method="POST" name="snd" action="build.php"> 
			<input type="hidden" name="id" value="25" /> 
			<input type="hidden" name="z" value="420e0d" /> 
			<input type="hidden" name="a" value="2" /> 
			<table cellpadding="1" cellspacing="1" class="build_details"> 
				<thead> 
					<tr> 
						<td>Nome</td> 
						<td>Numero</td> 
						<td>max</td> 
					</tr> 
				</thead> 
				<tbody> 
					
				<tr> 
					<td class="desc"> 
						<div class="tit"> 
							<img class="unit u11" src="img/x.gif" alt="Combattente" title="Combattente" /> 
							<a href="#" onClick="return Popup(11,1);">Combattente</a> <span class="info">(Presenti: 0)</span> 
						</div> 
						<div class="details"> 
							<img class="r1" src="img/x.gif" alt="Legno" title="Legno" />95|<img class="r2" src="img/x.gif" alt="Argilla" title="Argilla" />75|<img class="r3" src="img/x.gif" alt="Ferro" title="Ferro" />40|<img class="r4" src="img/x.gif" alt="Grano" title="Grano" />40|<img class="r5" src="img/x.gif" alt="Consumo di grano" title="Consumo di grano" />1|<img class="clock" src="img/x.gif" alt="durata" title="durata" />0:09:43
						</div> 
					</td> 
					<td class="val"> 
						<input type="text" class="text" name="t1" value="1" maxlength="4"> 
					</td> 
					<td class="max"> 
						<a href="#" onClick="document.snd.t1.value=14; return false;">(14)</a> 
					</td> 
				</tr> 
			
				<tr> 
					<td class="desc"> 
						<div class="tit"> 
							<img class="unit u12" src="img/x.gif" alt="Lanciere" title="Lanciere" /> 
							<a href="#" onClick="return Popup(12,1);">Lanciere</a> <span class="info">(Presenti: 0)</span> 
						</div> 
						<div class="details"> 
							<img class="r1" src="img/x.gif" alt="Legno" title="Legno" />145|<img class="r2" src="img/x.gif" alt="Argilla" title="Argilla" />70|<img class="r3" src="img/x.gif" alt="Ferro" title="Ferro" />85|<img class="r4" src="img/x.gif" alt="Grano" title="Grano" />40|<img class="r5" src="img/x.gif" alt="Consumo di grano" title="Consumo di grano" />1|<img class="clock" src="img/x.gif" alt="durata" title="durata" />0:15:07
						</div> 
					</td> 
					<td class="val"> 
						<input type="text" class="text" name="t2" value="0" maxlength="4"> 
					</td> 
					<td class="max"> 
						<a href="#" onClick="document.snd.t2.value=9; return false;">(9)</a> 
					</td> 
				</tr> 




dovrei cambiare il "value" del calss"val" e mettergli un valore diverso, però non so con quale code ottenere questo elemento.... e come modificarlo, ho provato a modificare manualmente l'html e a caricare la pagina secondo il nuovo html ma non và c'è bisogno di una classe come quella usata nel "login automatico" per modificare il text... sapete darmi una mano?
Ultima modifica effettuata da salva94 27/04/10 21:24
aaa
28/04/10 13:56
salva94
sisi prima di scrivere questo post ho visto quel link... ma non capisco come focalizzare solamente
<td class="val"> 
                        <input type="text" class="text" name="t1" value="1" maxlength="4"> 
                    </td> 
aaa
30/04/10 10:02
Il Totem
Hai provato Document.All("t2";) ?
aaa
30/04/10 12:51
salva94
scusami e come faccio a ottenerlo? Cioè io faccio
 WebBrowser1.Document.All("t2").Focus()

e poi?
aaa
01/05/10 12:31
Il Totem
.SetAttribute("class", "val2";)

Comunque c'è scritto nel link che ti ho già dato, leggi meglio.
aaa
07/05/10 11:49
salva94
scusate se scrivo molto in ritardo, in questi giorni sono stato impegnato .
Volevo dire che questo Setattribute dove lo devo inserire? Devo fare un create element? Devo creare un Dizionario?
aaa
21/05/10 19:21
Federico_VbNet_Programmer
Per fare il focus in un oggetto nel webbrowser fai:
WebBrowser1.Document.All(nome oggetto).Focus()
e per cambiare il testo fai:
WebBrowser1.Document.All(nome oggetto).innertext = testo che vuoi
Dimmi come va a finire :D
aaa