apparantly, its impossible to set the value of a <input type=file> element in a webbrowser..
anyone know how to set text to elements like this without using sendkeys (ie WM_SETTEXT).. how would i figure out the elements hwnd?
Printable View
apparantly, its impossible to set the value of a <input type=file> element in a webbrowser..
anyone know how to set text to elements like this without using sendkeys (ie WM_SETTEXT).. how would i figure out the elements hwnd?
i dont know will this help u but u should check it out.
doesnt help..
There have been multiple posts about things like this in the past. Mostly from a user called EJ12N, and I believe he found the answer and posted it. It has something to do with the Document Object Model... Try searching..
Phreak
http://www.vbforums.com/showthread.p...ghlight=object
might be what youre referring to. otherwise i cant find anything :/
but that post doesnt answer the question :(
you remembered me :DQuote:
Originally posted by «°°phReAk°°»
There have been multiple posts about things like this in the past. Mostly from a user called EJ12N, and I believe he found the answer and posted it. It has something to do with the Document Object Model... Try searching..
Phreak
anyways...like phreak said use DOM...
With WebBrowser1.Document
.getElementById("email").Value = sEmail
End With
That will set the element with name email in this case was a textbox with the value or variable sEmail
Hope that helps :wave:
thanks, but that wont work :)
input type=file elements cannot have their value set that way..
the only thing that has worked in the past was sendkeys, but that requires app focus...
is there another way?
bump
Do it with javascript :p
ie.Navigate "javascript:document.write('<html><body><input type=file id=txtFile></body></html>');"
ie.Navigate "javascript:document.write('<html><body><input type=password id=txtPass></body></html>');"
ie.Navigate "javascript:document.write('<html><body><input type=text id=txtName></body></html>');"
:wave: Hope that's what you mean
i need to set the value of them, not create them :)
ie.
<input type=file name=something>
how can i set the value of this element? you cannot do it with the DOM
How you do it in HTML :p i 4got post it here then i might be able to solve it ...Quote:
how can i set the value of this element? you cannot do it with the DOM
with dom it would be
wb.document.forms(0).something.value = "whatever"
but you cannot set the value of input type=file with DOM
No i want raw HTML how you do it...Quote:
Originally posted by VaxoP
with dom it would be
wb.document.forms(0).something.value = "whatever"
but you cannot set the value of input type=file with DOM
what value you want to change ?... -.-
you just said change value of type=file but what value i changed type= value in above post... to other value else tell what value u want to change....
i need to know in general..
it is impossible to set the value of input type=file with dom
impossible.
doesnt matter how big the box is, no matter what style it has, or its name
ALL input type=file cannot have their value set by DOM..
i need to know how to set their value without using DOM, without using sendkeys
People, people, people..... 1) I don't think it can be done. It's a security thing. Prevents people for using hidden file tags to upload files w/o the user knowing. Bad juju. 2) If some one does figure out how to do it, please post your web site, I want to mark it on my list of places to never visit.
TG
a software named "Gator" enters username password all my personal info when ever a form appers in web browser, i think this theread is like that
gator fills input type = 'anything BUT file'
i dont want to do this with HTML, i am aware MS has purposely made it so you cannot set the value of the element.
i dont want to do this with DOM either, as it probably cannot be done.
but there MUST be a way to do it with api??
i mean theres a very simple way..
wb.document.forms(0).element_file.focus
sendkeys whatever
but that requires focus to the app.. isnt there ANY other way?
bump
^^;
bump
Bumper...have fun
The Bump Thread :wave: