Set a textbox value probem

924 views
Skip to first unread message

fattysc

unread,
Sep 1, 2014, 9:55:32 AM9/1/14
to cefs...@googlegroups.com
Hello, I'm having a problem setting a textbox's value on a cefsharp browser via a textbox on a c# windows form.

This code works below.
browser.ExecuteScriptAsync("document.getElementById('Email').value= 'USER EMAIL STRING'");


But this does not.
browser.ExecuteScriptAsync(string.Concat(@"""document.getElementById('Email').value= '", txtEmail.Text + "'" + @""""));


I don't get any IDE errors or anything. But, it just won't set the value. Any ideas?

fattysc

unread,
Sep 1, 2014, 12:19:38 PM9/1/14
to cefs...@googlegroups.com
I figured it out by myself. None the less here is the code needed to use a windows form textbox with the ExecuteScriptAsync command.

browser.ExecuteScriptAsync("document.getElementById('Email').value=" + '\''+this.txtEmail.Text+'\'');
Reply all
Reply to author
Forward
0 new messages