Click here to Skip to main content
16,016,678 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have a website, there are some text areas I want to fill programically.
I open the website in my webbrowser1 control in my c# application and I have made a function Settext. This function works really well with textboxes, but seems to fail with text areas, any ideas why?

SetText("name" "details" "Hello"); But it doesnt work. Any ideas?

XML
<textarea name="details" id="details" cols="35" wrap="physical" rows="1"  önfocus="this.style.height='55px';" style="width: 300px; height: 55px;"></textarea>


SetText(string attribute, string attName, string value)
        {


            Skybound.Gecko.GeckoElementCollection tagsCollection = ((Skybound.Gecko.GeckoWebBrowser)(tabControl2.SelectedTab.Controls[0])).Document.GetElementsByTagName("textarea");

            foreach (Skybound.Gecko.GeckoElement currentTag in tagsCollection)
            {

               // MessageBox.Show(currentTag.GetAttribute(attribute));
                // If the attribute of the current tag has the name attName

                if (currentTag.GetAttribute(attribute).Equals(attName))
                {

                    // Then set its attribute "value".

                    currentTag.SetAttribute("value", value);

                    currentTag.Focus();
                }
            }



            //  SendKeys.Send("{ENTER}");

        }
Posted
Comments
[no name] 20-Jul-13 8:33am    
"Any ideas" pretty much the same exact idea that you have already been told. Why are you reposting this?

1 solution

You're using a third party web browser control. Talk to the people who made it if you're having problems with it.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900