Autor Beitrag
BigBen4ever
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 98



BeitragVerfasst: Mi 22.02.06 03:10 
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
<tr><td align=right width=33% valign=top>
<input type=radio name="selling-shipping" value=will-ship-domestic CHECKED>

</td><td width=66% valign=top align=left>
<font face=verdana,arial,helvetica size=-1><font color="#000000"><b>Versand </b></font><br><font face=verdana,arial,helvetica size=-2> </font></font>
</td></tr>

<tr><td align=right width=33% valign=top>

<input type=radio name="selling-shipping" value=will-ship-european-union >

</td><td width=66% valign=top align=left>
<font face=verdana,arial,helvetica size=-1><font color="#000000"><b>Versand innerhalb der EU, der Schweiz und Liechtenstein</b></font><br><font face=verdana,arial,helvetica size=-2> </font>
</td></tr>


<tr><td align=right width=33% valign=top>

<input type=radio name="selling-shipping" value=will-ship-european-international >

</td><td width=66% valign=top align=left>
<font face=verdana,arial,helvetica size=-1><b class="small">Versand innerhalb Europas (auch Nicht-EU-Länder)</b></font>
</td></tr>


<tr><td align=right width=33% valign=top>

<input type=radio name="selling-shipping" value=will-ship-intl >


Welche Möglichkeit habe ich, um den dritten Radio Button auszuwählen? Habe schon viel versucht, leider ohne Erfolg, gründliche Recherche per google ergab auch nichts, auf SwissDelphi gab es etwas, was leider nicht gefunzt hat, weiß hier jemand Rat?

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
procedure TForm1.Button6Click(Sender: TObject);

var
  Document: IHTMLDocument2;
  rbTestList: IHTMLElementCollection;
  rbTest: IHTMLOptionButtonElement;
  I: Integer;
begin
  // Get a reference to the document
  // Referenz auf Dokument
  Document := WebBrowser1.Document as IHTMLDocument2;

  // Get a reference to input-control (Radiobutton)
  // Referenz auf Eingabe-Control-Element (Radiobutton)
  rbTestList := Document.all.item('rating', EmptyParam) as IHTMLElementCollection;

  // Get current values.
  // Aktuellen Wert auslesen
  for I := 0 to rbTestList.Length - 1 do
  begin
    // reference to the i. RadioButton
    // Referenz auf i. RadioButton
    rbTest := rbTestList.item(I, EmptyParam) as IHTMLOptionButtonElement;

    // Show a message if radiobutton is checked
    // Anzeigen, wenn dieser RadioButton ausgewählt
    if rbTest.Checked then
      ShowMessageFmt('Der RadioButton mit dem Wert %s' +
        ' ist ausgewählt!', [rbTest.Value]);
  end;

  // Set new values
  // Neuen Wert setzen
  for I := 0 to rbTestList.Length - 1 do
  begin
    // reference to the i. RadioButton
    // Referenz auf i. RadioButton
    rbTest := rbTestList.item(I, EmptyParam) as IHTMLOptionButtonElement;

    // check radiobutton with value 3.
    // Wir möchten den RadioButton mit dem Wert "3" aktivieren
    if rbTest.Value = '3' then
      rbTest.Checked := True;
  end;
end;


Undefinierter Bezeichner IHTMLDocument2,IHTMLElementCollection,IHTMLOptionButtonElement
muss ich hierfür noch etwas in die uses hauen oder etwas bestimmtes auf meiner form haben??
Wo lege ich den namen der radio box fest?

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
//WebBrowser1.OleObject.Document.forms.item(0).selling-shipping.click;
//WebBrowser1.OleObject.Document.forms.item(0).selling-shipping.click.will-ship-european-international.click;

//webBrowser1.OleObject.Document.Forms.item(0).elements.item('bla').click;
//webBrowser1.OleObject.Document.All.Item('bla').Value :='bla';


Funzt auch alles nicht.

HILFE
digi_c
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1905

W98, XP
D7 PE, Lazarus, WinAVR
BeitragVerfasst: Mi 22.02.06 09:01 
Ich denke es scheitert bei dir an einer vernünftigen Installation von TWebbrowser:
dsdt.info/tipps/?id=582
BigBen4ever Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 98



BeitragVerfasst: Mi 22.02.06 09:33 
Und dann funktioniert der oben gepostete code?

Um das Ganze zu nutzen geht man wie folgt vor:

1.) Installiert die Microsoft Internet Controls (Version 1.1)-AktiveX-Komponente.(Komponente-ActiveX importieren)
2.) Unter AktiveX findet Ihr jetzt TWebBrowser und TWebBrowser_V1.


Das tun..und dann twebbrowser oder den v1 nutzen??

Bin irgendwie leicht verwirrt, hab ihn damals in dem Indy Pack (7?)..installiert...