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:
<div class="input2">
<input type="file" name="embedthumb" class="textField" size="30" /><br />
<div class=error id="thumbError" >Error: No video thumbnail selected to upload.</div>
</div>
Here is what i tried :
vb Code:
WebBrowser2.Document.All("embedthumb").Value = Text7.Text
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
Re: Help filling in this online form.
Hi thanks for the constructive piece of work.
Is there a simpler way though? thanks
Re: Help filling in this online form.
Quote:
Originally Posted by
Skunk1311
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.
Re: Help filling in this online form.
isnt the dhtml method the method that i tried first?
looks quite similar..
vb Code:
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:
WebBrowser2.Document.All("title").Value = Text1.Text
WebBrowser2.Document.All("tags").Value = Text2.Text
WebBrowser2.Document.All("vdescription").Value = Text3.Text
but the last one wont fill with that method.
Re: Help filling in this online form.
Perhaps something like this...
vb Code:
Private Sub WebBrowser2_DocumentComplete(ByVal pDisp As Object, URL As Variant)
For Each GenElmt In Doc.frames.Document.All
'~~> You have to use .tagname or some other property
'~~> Which relates to "embedthumb"
If UCase$(GenElmt.tagName) = <Something> Then
Set InptElmt = GenElmt
'~~> You have to use .value or some other property
'~~> Which relates to "embedthumb"
If UCase$(InptElmt.Value) = <Something> Then
'~~> Add finally add text
InptElmt.Value = Text7.Text
End If
End If
Next
End Sub
Re: Help filling in this online form.
im getting "Expected Expression" after
vb Code:
If UCase$(GenElmt.tagName) = <Something> Then
Here is all my code.. :
vb Code:
Private Sub Command1_Click()
With WebBrowser2
.Navigate "http://tada.co.uk/embedvideo.php"
End With
Do Until WebBrowser2.ReadyState = READYSTATE_COMPLETE
DoEvents
Loop
WebBrowser2.Document.All("title").Value = Text1.Text
WebBrowser2.Document.All("tags").Value = Text2.Text
WebBrowser2.Document.All("vdescription").Value = Text3.Text + " " + "tada.co.uk"
WebBrowser2.Document.All("mins").Value = Text4.Text
WebBrowser2.Document.All("secs").Value = Text5.Text
WebBrowser2.Document.All("category").Value = Text8.Text
WebBrowser2.Document.All("url").Value = Text6.Text
For Each GenElmt In WebBrowser2.Document.frames.Document.All
If UCase$(GenElmt.Name) = <embedthumb> Then
Set InptElmt = GenElmt
'~~> You have to use .value or some other property
'~~> Which relates to "embedthumb"
If UCase$(InptElmt.Value) = <embedthumb> Then
'~~> Add finally add text
InptElmt.Value = Text7.Text
End If
End If
Next
End Sub
Re: Help filling in this online form.
Change
Quote:
If UCase$(GenElmt.Name) = <embedthumb> Then
Code:
If UCase$(GenElmt.Name) = "embedthumb" Then
and
Quote:
If UCase$(InptElmt.Value) = <embedthumb> Then
to
Code:
If UCase$(InptElmt.Value) = "embedthumb" Then
Re: Help filling in this online form.
Quote:
Originally Posted by
Skunk1311
im getting "Expected Expression" after
vb Code:
If UCase$(GenElmt.tagName) = <Something> Then
Here is all my code.. :
vb Code:
Private Sub Command1_Click()
With WebBrowser2
.Navigate "http://tada.co.uk/embedvideo.php"
End With
Do Until WebBrowser2.ReadyState = READYSTATE_COMPLETE
DoEvents
Loop
WebBrowser2.Document.All("title").Value = Text1.Text
WebBrowser2.Document.All("tags").Value = Text2.Text
WebBrowser2.Document.All("vdescription").Value = Text3.Text + " " + "tada.co.uk"
WebBrowser2.Document.All("mins").Value = Text4.Text
WebBrowser2.Document.All("secs").Value = Text5.Text
WebBrowser2.Document.All("category").Value = Text8.Text
WebBrowser2.Document.All("url").Value = Text6.Text
For Each GenElmt In WebBrowser2.Document.frames.Document.All
If UCase$(GenElmt.Name) = <embedthumb> Then
Set InptElmt = GenElmt
'~~> You have to use .value or some other property
'~~> Which relates to "embedthumb"
If UCase$(InptElmt.Value) = <embedthumb> Then
'~~> Add finally add text
InptElmt.Value = Text7.Text
End If
End If
Next
End Sub
this site does not have any upload box :confused:
http://tada.co.uk/embedvideo.php
Re: Help filling in this online form.
thats not the real site lol, the site i am using would not be allowed :p i used that as an example i didnt even know it was real.
Re: Help filling in this online form.
oh is http://www.vbforums.com/images/smilies/tongue.gif
any way, if you can pm me the site. i can check it for you bit lator :)
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