|
-
Apr 5th, 2009, 12:26 PM
#1
Thread Starter
Addicted Member
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
-
Apr 5th, 2009, 01:09 PM
#2
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
-
Apr 5th, 2009, 01:14 PM
#3
Thread Starter
Addicted Member
Re: Help filling in this online form.
Hi thanks for the constructive piece of work.
Is there a simpler way though? thanks
-
Apr 5th, 2009, 11:45 PM
#4
Re: Help filling in this online form.
 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.
-
Apr 6th, 2009, 04:49 AM
#5
Thread Starter
Addicted Member
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.
Last edited by Skunk1311; Apr 6th, 2009 at 04:58 AM.
-
Apr 6th, 2009, 04:57 AM
#6
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
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
-
Apr 6th, 2009, 06:34 AM
#7
Thread Starter
Addicted Member
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
-
Apr 6th, 2009, 07:39 AM
#8
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
-
Apr 6th, 2009, 08:40 AM
#9
Re: Help filling in this online form.
 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 
http://tada.co.uk/embedvideo.php
-
Apr 6th, 2009, 09:07 AM
#10
Thread Starter
Addicted Member
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.
-
Apr 6th, 2009, 09:12 AM
#11
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
-
Apr 6th, 2009, 11:18 AM
#12
Thread Starter
Addicted Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|