Jump to content

How to fill the SELEKT field (WEB)

- - - - -

  • Please log in to reply
No replies to this topic

#1
Yuran

Yuran

    Newbie

  • Members
  • Pip
  • 3 posts
Hi all,

As on this site: Îòïðàâêà SMS how to fill the SELEKT field?

Here my code:
void __fastcall TForm1::Button6Click(TObject *Sender)

{

      /*  IDispatch *pDisp1=NULL; TVariant vIndex = 2;

        IHTMLElementCollection *pAll ;


          TVariant vName1 = "prefix"; // ??? HTML ????

          if(SUCCEEDED(pAll->item(vName1, vIndex, &pDisp1)) && pDisp1)

            {

             IHTMLSelectElement *pInput = NULL;

             if(SUCCEEDED(pDisp1->QueryInterface(IID_IHTMLSelectElement,(LPVOID*)&pInput)) && pInput)

               {

                pInput->put_value(WideString("String"));

                pInput->Release();

               }

             pDisp1->Release();

            }

*/

    IHTMLDocument2 *htm = 0;

    WB->Document->QueryInterface(&htm);

    if(htm)

    {

        IHTMLElementCollection *col = 0;

        htm->get_all(&col);

        if(col)

        {

            IDispatch *el_disp = 0;

            col->item(TVariant(L"prefix"), TVariant(0), &el_disp);   // Здесь указывается имя тега ("pole_1") с которым мы работаем

            if(el_disp)

            {

                IHTMLElement *el = 0;

                el_disp->QueryInterface(&el);

                if(el)

                {

                    el->setAttribute(L"value", TVariant(L"2"), 0); // Здесь переменной "value" присваиваем значение "2"

                    el->Release();

                    el = 0;

                }

                el_disp->Release();

                el_disp = 0;

            }

            col->Release();

            col = 0;

        }

        htm->Release();

        htm = 0;

    }



}

If to make so that field it is only cleared. What to me to do?

(WB it WebBrowser)




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users