Answered by:
How to enter text into a textbox

Question
-
Hi guys,
I'm trying to enter text into a search textbox on a Webbrowser control on a window form. When I do it manually, I enter some text into the search textbox, the "search" button is enabled, or I can just hit the Enter key and the search will begin. However, when I try to simulate the same steps with the below codes, it doesn't seem to recognize that I already entered the text and enable the "search" button.
Below is my code. Please help.
public void SetPickupLoc(string PuName, string PuAddr, string PuCity, string PuState, string PuZip)
{
wbPage.Document.GetElementById("change-pickup-from-btn").InvokeMember("click");
while (wbPage.Document.GetElementById("cpf-save-btn") == null) { Application.DoEvents(); }
wbPage.Document.GetElementById("gci-input").SetAttribute("Value", "G2099212");
wbPage.Document.GetElementById("gci-input-search").InvokeMember("click");}
- Moved by Sabah ShariqMVP Wednesday, March 1, 2017 11:58 AM Moved From Visual C#
- Edited by smnexpd Wednesday, March 1, 2017 11:00 PM
Tuesday, February 28, 2017 10:47 PM
Answers
-
Hi smnexpd,
This is Visual C# forum. As your issue is related to Web, please ask your question into ASP.Net forum for getting quick response. I am moving your thread to off-topic.
https://forums.asp.net/
Your understanding and cooperation will be grateful.Thanks,
Sabah Shariq[If a post helps to resolve your issue, please click the "Mark as Answer" of that post or click
"Vote as helpful" button of that post. By marking a post as Answered or Helpful, you help others find the answer faster. ]
- Marked as answer by smnexpd Wednesday, March 1, 2017 10:43 PM
Wednesday, March 1, 2017 11:57 AM -
Thanks Wendy. I'll try that.
- Marked as answer by smnexpd Wednesday, March 1, 2017 10:42 PM
Wednesday, March 1, 2017 10:42 PM
All replies
-
Just a wild guess, perhaps you need to raise the onchange event of the input.
See RaiseEvent
Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
VB Forums - moderator
Wednesday, March 1, 2017 12:11 AM -
Hi smnwxpd,
Thank you for posting here.
According to your question is more related to web form, you could post a new thread in Web Forms forum for suitable support.
The Visual C# discuss and ask the C# programming language, IDE, libraries, samples and tools.
If you have some grammar or code errors, please feel free to contact us. We will try our best to give you a solution.
Thanks for your understanding and cooperation.
Best Regards,
Wendy
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.- Proposed as answer by Wendy ZangMicrosoft contingent staff Thursday, March 16, 2017 7:20 AM
Wednesday, March 1, 2017 2:21 AM -
Hi smnexpd,
This is Visual C# forum. As your issue is related to Web, please ask your question into ASP.Net forum for getting quick response. I am moving your thread to off-topic.
https://forums.asp.net/
Your understanding and cooperation will be grateful.Thanks,
Sabah Shariq[If a post helps to resolve your issue, please click the "Mark as Answer" of that post or click
"Vote as helpful" button of that post. By marking a post as Answered or Helpful, you help others find the answer faster. ]
- Marked as answer by smnexpd Wednesday, March 1, 2017 10:43 PM
Wednesday, March 1, 2017 11:57 AM -
Thanks Wendy. I'll try that.
- Marked as answer by smnexpd Wednesday, March 1, 2017 10:42 PM
Wednesday, March 1, 2017 10:42 PM -
Thanks Sabah. I'll try that.Wednesday, March 1, 2017 10:43 PM
-
Hi Wendy,
My apology, it's actually not webform but Windows Form. I'm working on a Windows Form Application. Which forum should I post that question to?
Wednesday, March 1, 2017 10:52 PM -
Hi smnexpd,
Thank you for feedback.
Sorry for that I do not have permission to move your thread back. You could post a new thread in Windows Forms General.
Best Regards,
Wendy
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.- Edited by Wendy ZangMicrosoft contingent staff Thursday, March 2, 2017 1:51 AM
- Proposed as answer by Wendy ZangMicrosoft contingent staff Thursday, March 16, 2017 7:20 AM
Thursday, March 2, 2017 1:51 AM