1

i need to update the design of a browser in delphi7 I was using the twebbrowser but he had many problems with javascript and navigation.. so i decide to migrate to Chromium. the problem is that I cannot find code on these components. does anyone know which command would be equivalent to this one in tchromium:

OleObject.Document.all.Item ('ElementbyId', 0) .value: = 'edit1.text';

i need to transfer a text from memo to textarea in html form and at the end send a click on the button on the html form. if anyone knows the commands and can share I appreciate it.

2
  • What components? The third party CEF4Delphi or the new Chrome based Edge support in the box? Commented Apr 13, 2021 at 4:47
  • Assuming this is the Briskbard CEF4Delphi TChromium component, you should go and read the forums on the Briskbard site. There is a lot of information there, your question has been discussed there many times. Start by googling for "briskbard dom". Also be aware that you will probably want to go down the ExecuteJavascript route rather than the CEF DOM functions. Commented Apr 13, 2021 at 4:53

1 Answer 1

1

A more flexible alternative than DOM access could be to perform this in Javascript, with the ExecuteJavaScript method of TChromium.

From your summary description, the JS could be something like

document.getElementById('yourtextarea').value = <JSON stringified content of your memo>;
document.getElementById('yourform').submit();

Alternatively, you could implement a JS function in your HTML, and call it with ExecuteJavascript, this way there would not be anything specific (besides the function name) on the Delphi side, and the HTML would be free to evolve.

function setTextAreaAndSubmit(value) {
    document.getElementById('yourtextarea').value = value;
    document.getElementById('yourform').submit();
}
Sign up to request clarification or add additional context in comments.

1 Comment

I'm afraid OP avoids JavaScript because of not understanding nested literals.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.