|
-
Nov 27th, 2009, 12:07 AM
#1
Thread Starter
Addicted Member
How to add text to a textbox in webbrowser control with random identifiers
Hi all,
I am attempting to send a string to a textbox in the webbrowser control and the page I am trying to do this with has random name= and value= fields which makes it difficult to use the typical methods for placing text in the textbox. I have spent quite a bit of time searching and attempting to figure this out and I'm stumped. Any help would be appreciated.
Example:
Code:
<span class="req">Example Textbox:</span><br>
<input type="hidden" class="point" name="U2FsdGVkX18xODA2MDE4MAtiYv1QcVMTlaG1QZmsXCTFDSbneXPOpDDkdDv9KIygapaXLEwrDHg" value="U2FsdGVkX18xODA2MDE4MDvLMJlAuWhymddirLsfDt0Aa9Jm75TdDlce-wM9zO3MGNI9f8JXHW4">
<input class="req" tabindex="1" type="text"
name="U2FsdGVkX18xODA2MDE4MMZfVR2sB_tOWEzuk6.mCZPmQ:f8kwMmMfDECi8JhBBIrOUSFHBGdffVA"
id = "U2FsdGVkX18xODA2MDE4MMZfVR2sB_tOWEzuk6.mCZPmQ:f8kwMmMfDECi8JhBBIrOUSFHBGdffVA"
size="30" maxlength="70"
value="">
-
Nov 27th, 2009, 12:15 AM
#2
Re: How to add text to a textbox in webbrowser control with random identifiers
Does the name changes from time. I wont Agree..Check and comeback
Please mark you thread resolved using the Thread Tools as shown
-
Nov 27th, 2009, 12:20 AM
#3
Thread Starter
Addicted Member
Re: How to add text to a textbox in webbrowser control with random identifiers
 Originally Posted by danasegarane
Does the name changes from time. I wont Agree..Check and comeback
Yes it does change,
For example, below is how it appears in the browser source after i cleared my cache, cookies, etc. and refreshed the page just moments ago:
Code:
<span class="req">Example Textbox 2:</span><br>
<input class="req" tabindex="1" type="text"
name="U2FsdGVkX18xNTEwMT.E1MZ0XrzLLUQqnK45.gQiX7W.N5BlwtuZzcfpIunlXaoMnV0tNg2ClSIuzA"
id = "U2FsdGVkX18xNTEwMT.E1MZ0XrzLLUQqnK45.gQiX7W.N5BlwtuZzcfpIunlXaoMnV0tNg2ClSIuzA"
size="30" maxlength="70"
value="">
-
Nov 27th, 2009, 12:29 AM
#4
Re: How to add text to a textbox in webbrowser control with random identifiers
Please mark you thread resolved using the Thread Tools as shown
-
Nov 27th, 2009, 12:34 AM
#5
Thread Starter
Addicted Member
Re: How to add text to a textbox in webbrowser control with random identifiers
 Originally Posted by danasegarane
Post the Website Link..
I have sent you a PM with the link. Thanks.
-
Nov 27th, 2009, 02:03 AM
#6
Thread Starter
Addicted Member
Re: How to add text to a textbox in webbrowser control with random identifiers
does anyone else have any suggestions or tips?
-
Nov 28th, 2009, 12:38 PM
#7
Thread Starter
Addicted Member
Re: How to add text to a textbox in webbrowser control with random identifiers
I wasn't able to get the answer I was looking for here, but I did come up with a rough work around by parsing out the name which may be helpful to someone else with the same issue, So, I'm posting it below. If someone knows of a better way, please post it here:
Code:
TmpData = WB1.DocumentText.ToString
tmp1 = Mid(TmpData, InStr(TmpData, "Example Textbox 1:") + 19)
tmp1 = Mid(tmp1, InStr(tmp1, "tabindex=") + 10)
tmp1 = Mid(tmp1, InStr(tmp1, "name=") + 6)
tmp1 = Microsoft.VisualBasic.Left(tmp1, InStr(tmp1, """") - 1)
WB1.Document.Forms("postingForm").All(tmp1).SetAttribute("value", "Example text")
Last edited by SavedByGrace; Nov 28th, 2009 at 12:39 PM.
Reason: correcting spelling typos
Tags for this Thread
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
|