Results 1 to 12 of 12

Thread: Help filling in this online form.

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2008
    Posts
    177

    Help filling in this online form.

    Its a upload form on my page, i can fill in normal text boxes but am having trouble with this upload one.

    Im trying to get the text from my text7 textbox and put it in the online textbox.

    Here is the html :

    PHP Code:
                    <div style="height:10px;"></div>
                    
    Thumbnail:&nbsp;
                    <
    div class="input2">
                    <
    input type="file" name="embedthumb" class="textField" size="30" /><br />

                    <
    div class=error id="thumbError" >ErrorNo video thumbnail selected to upload.</div>
                    </
    div
    Here is what i tried :

    vb Code:
    1. WebBrowser2.Document.All("embedthumb").Value = Text7.Text

  2. #2
    PowerPoster Fazi's Avatar
    Join Date
    Aug 2005
    Location
    Underworld
    Posts
    2,525

    Re: Help filling in this online form.

    There are few method to upload a file to a 'upload text box" in a web form.
    the best way i found is here. it uses the multipart form data method.

    http://www.vbforums.com/showthread.php?t=531278

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Nov 2008
    Posts
    177

    Re: Help filling in this online form.

    Hi thanks for the constructive piece of work.

    Is there a simpler way though? thanks

  4. #4
    PowerPoster Fazi's Avatar
    Join Date
    Aug 2005
    Location
    Underworld
    Posts
    2,525

    Re: Help filling in this online form.

    Quote Originally Posted by Skunk1311 View Post
    Hi thanks for the constructive piece of work.

    Is there a simpler way though? thanks
    There two more ways, 1. using HTML DOM 2 SendKeys()

    For the DOM, check this example
    http://www.vbforums.com/showpost.php...78&postcount=2

    you need to give the html control names correctly. use firebug (for firefox) or IE Developer toolbar (for IE) to inspect the names of the control in the webapge your trying.

    for sendKeys, pls search the forum for SendKeys. i remember i answered a similler question (sending a file to a web form) way back. ill try to find that here.

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Nov 2008
    Posts
    177

    Re: Help filling in this online form.

    isnt the dhtml method the method that i tried first?

    looks quite similar..

    vb Code:
    1. WebBrowser2.Document.All("embedthumb").Value = Text7.Text

    tried the method with opening the internet explorer window but it didnt work.

    i thought it would be just as simple as filling in any other text box but it just wont fill this one.

    im using this to fill 3 other text boxs just fine :
    vb Code:
    1. WebBrowser2.Document.All("title").Value = Text1.Text
    2. WebBrowser2.Document.All("tags").Value = Text2.Text
    3. WebBrowser2.Document.All("vdescription").Value = Text3.Text

    but the last one wont fill with that method.
    Last edited by Skunk1311; Apr 6th, 2009 at 04:58 AM.

  6. #6
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    Re: Help filling in this online form.

    Perhaps something like this...

    vb Code:
    1. Private Sub WebBrowser2_DocumentComplete(ByVal pDisp As Object, URL As Variant)
    2.     For Each GenElmt In Doc.frames.Document.All
    3.         '~~> You have to use .tagname or some other property
    4.         '~~> Which relates to "embedthumb"
    5.         If UCase$(GenElmt.tagName) = <Something> Then
    6.             Set InptElmt = GenElmt
    7.             '~~> You have to use .value or some other property
    8.             '~~> Which relates to "embedthumb"
    9.             If UCase$(InptElmt.Value) = <Something> Then
    10.                 '~~> Add finally add text
    11.                 InptElmt.Value = Text7.Text
    12.             End If
    13.         End If
    14.     Next
    15. End Sub
    A good exercise for the Heart is to bend down and help another up...
    Please Mark your Thread "Resolved", if the query is solved


    MyGear:
    ★ CPU ★ Ryzen 5 5800X
    ★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
    ★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
    ★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
    ★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
    ★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
    ★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
    ★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
    ★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
    ★ Keyboard ★ TVS Electronics Gold Keyboard
    ★ Mouse ★ Logitech G502 Hero

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Nov 2008
    Posts
    177

    Re: Help filling in this online form.

    im getting "Expected Expression" after

    vb Code:
    1. If UCase$(GenElmt.tagName) = <Something> Then

    Here is all my code.. :

    vb Code:
    1. Private Sub Command1_Click()
    2. With WebBrowser2
    3.               .Navigate "http://tada.co.uk/embedvideo.php"
    4.          End With
    5.  
    6.          
    7.           Do Until WebBrowser2.ReadyState = READYSTATE_COMPLETE
    8.               DoEvents
    9.           Loop
    10.  
    11. WebBrowser2.Document.All("title").Value = Text1.Text
    12. WebBrowser2.Document.All("tags").Value = Text2.Text
    13. WebBrowser2.Document.All("vdescription").Value = Text3.Text + " " + "tada.co.uk"
    14. WebBrowser2.Document.All("mins").Value = Text4.Text
    15. WebBrowser2.Document.All("secs").Value = Text5.Text
    16. WebBrowser2.Document.All("category").Value = Text8.Text
    17. WebBrowser2.Document.All("url").Value = Text6.Text
    18.  
    19. For Each GenElmt In WebBrowser2.Document.frames.Document.All
    20.         If UCase$(GenElmt.Name) = <embedthumb> Then
    21.         Set InptElmt = GenElmt
    22.             '~~> You have to use .value or some other property
    23.             '~~> Which relates to "embedthumb"
    24.             If UCase$(InptElmt.Value) = <embedthumb> Then
    25.                 '~~> Add finally add text
    26.                 InptElmt.Value = Text7.Text
    27.             End If
    28.         End If
    29.     Next
    30. End Sub

  8. #8
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    Re: Help filling in this online form.

    Change

    If UCase$(GenElmt.Name) = <embedthumb> Then
    Code:
    If UCase$(GenElmt.Name) = "embedthumb" Then

    and

    If UCase$(InptElmt.Value) = <embedthumb> Then
    to

    Code:
    If UCase$(InptElmt.Value) = "embedthumb" Then
    A good exercise for the Heart is to bend down and help another up...
    Please Mark your Thread "Resolved", if the query is solved


    MyGear:
    ★ CPU ★ Ryzen 5 5800X
    ★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
    ★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
    ★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
    ★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
    ★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
    ★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
    ★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
    ★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
    ★ Keyboard ★ TVS Electronics Gold Keyboard
    ★ Mouse ★ Logitech G502 Hero

  9. #9
    PowerPoster Fazi's Avatar
    Join Date
    Aug 2005
    Location
    Underworld
    Posts
    2,525

    Re: Help filling in this online form.

    Quote Originally Posted by Skunk1311 View Post
    im getting "Expected Expression" after

    vb Code:
    1. If UCase$(GenElmt.tagName) = <Something> Then

    Here is all my code.. :

    vb Code:
    1. Private Sub Command1_Click()
    2. With WebBrowser2
    3.               .Navigate "http://tada.co.uk/embedvideo.php"
    4.          End With
    5.  
    6.          
    7.           Do Until WebBrowser2.ReadyState = READYSTATE_COMPLETE
    8.               DoEvents
    9.           Loop
    10.  
    11. WebBrowser2.Document.All("title").Value = Text1.Text
    12. WebBrowser2.Document.All("tags").Value = Text2.Text
    13. WebBrowser2.Document.All("vdescription").Value = Text3.Text + " " + "tada.co.uk"
    14. WebBrowser2.Document.All("mins").Value = Text4.Text
    15. WebBrowser2.Document.All("secs").Value = Text5.Text
    16. WebBrowser2.Document.All("category").Value = Text8.Text
    17. WebBrowser2.Document.All("url").Value = Text6.Text
    18.  
    19. For Each GenElmt In WebBrowser2.Document.frames.Document.All
    20.         If UCase$(GenElmt.Name) = <embedthumb> Then
    21.         Set InptElmt = GenElmt
    22.             '~~> You have to use .value or some other property
    23.             '~~> Which relates to "embedthumb"
    24.             If UCase$(InptElmt.Value) = <embedthumb> Then
    25.                 '~~> Add finally add text
    26.                 InptElmt.Value = Text7.Text
    27.             End If
    28.         End If
    29.     Next
    30. End Sub
    this site does not have any upload box
    http://tada.co.uk/embedvideo.php

  10. #10

    Thread Starter
    Addicted Member
    Join Date
    Nov 2008
    Posts
    177

    Re: Help filling in this online form.

    thats not the real site lol, the site i am using would not be allowed i used that as an example i didnt even know it was real.

  11. #11
    PowerPoster Fazi's Avatar
    Join Date
    Aug 2005
    Location
    Underworld
    Posts
    2,525

    Re: Help filling in this online form.

    oh is
    any way, if you can pm me the site. i can check it for you bit lator

  12. #12

    Thread Starter
    Addicted Member
    Join Date
    Nov 2008
    Posts
    177

    Re: Help filling in this online form.

    ok mate, i will pm you the site, although you would have to make an account to see the section, its free ofcourse.

    Although i did post the html to the textbox in the first post.

    thanks

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