Results 1 to 8 of 8

Thread: [RESOLVED] how to insert value in tetxbox of web page and clcik on button

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Mar 2005
    Posts
    2,586

    Resolved [RESOLVED] how to insert value in tetxbox of web page and clcik on button

    based this lin k:


    how to put value ="A" in red textbox Cognome, nome o rag sociale and clcik on button CERCA GEOMETRI in red

    Sorry but not experience with DOM.
    Attached Images Attached Images  
    Last edited by luca90; Jan 21st, 2022 at 02:06 AM.

  2. #2
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: how to insert value in tetxbox of web page and clcik on button

    you can try like
    Code:
    Set ele = ie.Document.getelementsbyname("jform[nome]")(0)
    ele.Value = "a"
    ele.form.submit
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Mar 2005
    Posts
    2,586

    Re: how to insert value in tetxbox of web page and clcik on button

    Quote Originally Posted by westconn1 View Post
    you can try like
    Code:
    set ele = ie.document.getelementsbyname("jform[nome]")(0)
    ele.value = "a"
    ele.form.submit
    great!

    SORRY bro, have idea to get value in listbox Vallata, think is a loop of item...
    Last edited by luca90; Jan 20th, 2022 at 03:45 AM.

  4. #4
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: how to insert value in tetxbox of web page and clcik on button

    try with
    Code:
    Set ele = ie.Document.getelementbyid("jform_vallata")
    ele.Value = ele.Item(5).Value
    you might have to loop the items to see which one you want to select

    Code:
    For Each i In ele.Options
        Debug.Print i.Value
    Next
    Last edited by westconn1; Jan 20th, 2022 at 04:40 AM.
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  5. #5

    Thread Starter
    PowerPoster
    Join Date
    Mar 2005
    Posts
    2,586

    Re: how to insert value in tetxbox of web page and clcik on button

    Quote Originally Posted by westconn1 View Post
    try with
    Code:
    Set ele = ie.Document.getelementbyid("jform_vallata")
    ele.Value = ele.Item(5).Value
    you might have to loop the items to see which one you want to select

    Code:
    For Each i In ele.Options
        Debug.Print i.Value
    Next
    Bro....
    i dont found the class to insert, for example in VALLATA listbox, the value "AREZZO" and click the button CERCA GEOMETRI...

    old example from other site...

    With IE.Document.forms(0)
    .Item("ctl00$ContentPlaceHolder1$ddlCodiceCollegio").Value = "AREZZO"
    .Item("ctl00$ContentPlaceHolder1$ddlCodiceCollegio").FireEvent ("onchange")
    .Item("ctl00$ContentPlaceHolder1$btnFiltra").Click
    End With
    Last edited by luca90; Jan 20th, 2022 at 05:51 AM.

  6. #6
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: [RESOLVED] how to insert value in tetxbox of web page and clcik on button

    and click the button CERCA GEOMETRI...
    that was not in the question
    well you already have the solution

    or was there some other question
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  7. #7

    Thread Starter
    PowerPoster
    Join Date
    Mar 2005
    Posts
    2,586

    Re: [RESOLVED] how to insert value in tetxbox of web page and clcik on button

    Quote Originally Posted by westconn1 View Post
    that was not in the question
    well you already have the solution

    or was there some other question
    ... I test, i cannot insert value in list box!
    i need to select it from listbox.

  8. #8
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    39,047

    Re: [RESOLVED] how to insert value in tetxbox of web page and clcik on button

    I see you started a thread on that subject. That was the right thing to do, since this thread was on a totally different question. Since this one is resolved, I'll close this one so that the other question can get all the attention.
    My usual boring signature: Nothing

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width