|
-
Aug 26th, 2004, 12:22 AM
#1
Thread Starter
Frenzied Member
How to send text to a textbox in a webbrowser w/out using sendkeys (input type=file)?
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?
Last edited by VaxoP; Aug 26th, 2004 at 01:35 AM.
-
Aug 26th, 2004, 12:28 AM
#2
i dont know will this help u but u should check it out.
-
Aug 26th, 2004, 12:34 AM
#3
Thread Starter
Frenzied Member
-
Aug 26th, 2004, 02:08 AM
#4
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
Visual Studio 6, Visual Studio.NET 2005, MASM
-
Aug 26th, 2004, 02:24 AM
#5
Thread Starter
Frenzied Member
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
-
Aug 26th, 2004, 02:30 AM
#6
Hyperactive Member
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
you remembered me 
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
Born to help others
(If I've been helpful then please rate my post. Thanks)
call me EJ or be slapped! 
-
Aug 26th, 2004, 03:02 AM
#7
Thread Starter
Frenzied Member
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?
-
Aug 26th, 2004, 02:20 PM
#8
Thread Starter
Frenzied Member
-
Aug 26th, 2004, 03:29 PM
#9
Hyperactive Member
Do it with javascript 
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>');"
Hope that's what you mean
Born to help others
(If I've been helpful then please rate my post. Thanks)
call me EJ or be slapped! 
-
Aug 26th, 2004, 03:57 PM
#10
Thread Starter
Frenzied Member
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
-
Aug 26th, 2004, 04:05 PM
#11
Hyperactive Member
how can i set the value of this element? you cannot do it with the DOM
How you do it in HTML i 4got post it here then i might be able to solve it ...
Born to help others
(If I've been helpful then please rate my post. Thanks)
call me EJ or be slapped! 
-
Aug 26th, 2004, 04:32 PM
#12
Thread Starter
Frenzied Member
with dom it would be
wb.document.forms(0).something.value = "whatever"
but you cannot set the value of input type=file with DOM
-
Aug 26th, 2004, 04:55 PM
#13
Hyperactive Member
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
No i want raw HTML how you do it...
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....
Born to help others
(If I've been helpful then please rate my post. Thanks)
call me EJ or be slapped! 
-
Aug 26th, 2004, 05:11 PM
#14
Thread Starter
Frenzied Member
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
-
Aug 26th, 2004, 05:19 PM
#15
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
-
Aug 26th, 2004, 08:27 PM
#16
Hyperactive Member
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
Regards,
Vishalgiri Goswami
Gujarat, ( INDIA ).
---------------------
-
Aug 26th, 2004, 08:59 PM
#17
Thread Starter
Frenzied Member
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?
-
Aug 27th, 2004, 02:17 AM
#18
Thread Starter
Frenzied Member
-
Aug 27th, 2004, 07:58 PM
#19
Thread Starter
Frenzied Member
-
Aug 29th, 2004, 02:42 PM
#20
Thread Starter
Frenzied Member
-
Aug 29th, 2004, 09:18 PM
#21
Hyperactive Member
Bumper...have fun
The Bump Thread
Born to help others
(If I've been helpful then please rate my post. Thanks)
call me EJ or be slapped! 
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
|