almoandrioli Posted June 3, 2017 Share Posted June 3, 2017 Hello, im new here. I want to know if its possible to send a value (string, number, etc) from my application to an web page input form. This is the html of the input that i want to pass the value: <input name="nmrProtocolo" type="text" size="12" maxlength="12" value=""> The page have this input and a Search Button. What i need -> I click on a field on my unidbgrid and then this page open with the number of the field on the input field. I only need to click on the search button on the page. Sorry for my english and explanation. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 3, 2017 Share Posted June 3, 2017 Hi,Please explain more, What do you mean by the web page?May can help, try:For example: procedure TMainForm.UniButton1Click(Sender: TObject); var yourInputElemName, newValue: string; begin yourInputElemName := 'nmrProtocolo'; newValue := 'Search value'; UniSession.AddJS('var _textEl = document.getElementsByName("'+ yourInputElemName +'")[0]; _textEl.value="'+ newValue +'"'); end; Best regards, Quote Link to comment Share on other sites More sharing options...
coffeeapp Posted June 6, 2017 Share Posted June 6, 2017 Hi Delphi Devoloper ! I could not reproduce the above code. Could you give an example of how to integrate ? Thanks ! Quote Link to comment Share on other sites More sharing options...
Georges Soares Posted June 10, 2017 Share Posted June 10, 2017 With me it did not work, follow the example. ProjectCnpj.rar Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 11, 2017 Share Posted June 11, 2017 Hi, It's cross-domain issue. You can almost embed any iframe but, if domains differ, you can not access the frame e.g. execute JS, modify DOM etc. Best regards, 1 Quote Link to comment Share on other sites More sharing options...
Georges Soares Posted June 11, 2017 Share Posted June 11, 2017 Via delphi vcl webbrowser I can manipulate this site, put it in the test project, if I can see Thanks Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted June 11, 2017 Administrators Share Posted June 11, 2017 In VCL you load web page directly inside your application. In uniGUI web page is loaded inside a frame in a browser. Quote Link to comment Share on other sites More sharing options...
Georges Soares Posted June 11, 2017 Share Posted June 11, 2017 Thanks for the answer. So it is not possible to insert value into an input or click a button on a page inside the urlframe. Thanks. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 11, 2017 Share Posted June 11, 2017 Yes, if domains differ Quote Link to comment Share on other sites More sharing options...
Georges Soares Posted June 12, 2017 Share Posted June 12, 2017 I would like to get all the HTML content of the page loaded in urlFrame, the view-source, how to do? thanks 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.