MOGSY Posted January 23, 2020 Share Posted January 23, 2020 Hi I would appreciate it if you could show how to add items to the combobox "company-list" in the attached project. I like to see an example of how to access elements on the UniHTMLFrame. attached is a test project. Thanks Test.7z Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 24, 2020 Share Posted January 24, 2020 14 hours ago, MOGSY said: I would appreciate it if you could show how to add items to the combobox "company-list" in the attached project. Hi, JS Code for example: var selEl = MainmForm.UnimHTMLFrame1.element.select('#company-list').elements[0]; if (selEl) { var opt = document.createElement('option'); opt.appendChild(document.createTextNode('New Company')); opt.value = 'newco1'; selEl.appendChild(opt); } Quote Link to comment Share on other sites More sharing options...
MOGSY Posted January 24, 2020 Author Share Posted January 24, 2020 Hi Thank you for your response, how do we pass the "newco1" from delphi to UnimHTMLFrame? Thanks you Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 24, 2020 Share Posted January 24, 2020 1 hour ago, MOGSY said: Thank you for your response, how do we pass the "newco1" from delphi to UnimHTMLFrame? procedure TMainmForm.UnimButton1Click(Sender: TObject); begin UnimHTMLFrame1.JSInterface.JSCode( 'var selEl = '#1'.element.select("#company-list").elements[0];'+ 'if (selEl) {'+ ' var opt = document.createElement("option");'+ ' opt.appendChild(document.createTextNode("New Company"));'+ ' opt.value = "newco1";'+ ' selEl.appendChild(opt);'+ '};' ); end; Quote Link to comment Share on other sites More sharing options...
MOGSY Posted January 24, 2020 Author Share Posted January 24, 2020 Thank you Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.