vlkc Posted April 5, 2012 Share Posted April 5, 2012 Can somebody explain how to work with UniURLFrame? How to get elements name or id in UniURLFrame? How to set text in UniURLFrame? Thanks Link to comment Share on other sites More sharing options...
Guest tendon Posted April 5, 2012 Share Posted April 5, 2012 Can somebody explain how to work with UniURLFrame? How to get elements name or id in UniURLFrame? How to set text in UniURLFrame? Thanks Did you try this?... MyUniURLFrame.URL := 'http://unigui.com' Link to comment Share on other sites More sharing options...
vlkc Posted April 5, 2012 Author Share Posted April 5, 2012 Did you try this?... MyUniURLFrame.URL := 'http://unigui.com' I know this, but the question was - How to get elements name or id in UniURLFrame? How to set text in UniURLFrame? Link to comment Share on other sites More sharing options...
Guest tendon Posted April 5, 2012 Share Posted April 5, 2012 I know this, but the question was - How to get elements name or id in UniURLFrame? How to set text in UniURLFrame? Not sure I understand the question fully. Does this help?... UniUrlFrame.ExtControl.GetId Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted April 5, 2012 Administrators Share Posted April 5, 2012 Next build will add HTML property to TUniUrlFrame which allows directly adding HTML content to UrlFrame. Link to comment Share on other sites More sharing options...
vlkc Posted April 5, 2012 Author Share Posted April 5, 2012 I will try to explain. Here is the code : <input type="text" class="inputtext" id="email" name="email" value="" onkeypress="formchange()" /> How can i extract name of input which id is email? Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted April 5, 2012 Administrators Share Posted April 5, 2012 I will try to explain. Here is the code : <input type="text" class="inputtext" id="email" name="email" value="" onkeypress="formchange()" /> How can i extract name of input which id is email? I really don't understand what you want to achieve. Do you want to retrieve "id" of TUniUrlFrame? If yes for what purpose? Please explain your problem in more details. Link to comment Share on other sites More sharing options...
Oliver Morsch Posted April 5, 2012 Share Posted April 5, 2012 I have an UrlFrame with the id "myUrlFrame" and a "div" on it with the name "myTile3". To get the text of this element, I use the following code: document.getElementById('myUrlFrame').contentWindow.document.getElementById('myTile3').firstChild.data; But the server and port must be exactly the same; Browsers deny access for security reasons, if you use another servername or port. Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted April 5, 2012 Administrators Share Posted April 5, 2012 I have an UrlFrame with the id "myUrlFrame" and a "div" on it with the name "myTile3". To get the text of this element, I use the following code: document.getElementById('myUrlFrame').contentWindow.document.getElementById('myTile3').firstChild.data; But the server and port must be exactly the same; Browsers deny access for security reasons, if you use another servername or port. OK. I understand him now. Yes above code is the only way to retrieve info from an embedded iframe. In uniGUI iframe id is "iframe_"+(Delphi Name) Conisder you have UniUrlFrame1 on Form. Its web id is iframe_UniUrlFrame1 Link to comment Share on other sites More sharing options...
vlkc Posted April 5, 2012 Author Share Posted April 5, 2012 How to get this input ID Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted April 5, 2012 Administrators Share Posted April 5, 2012 How to get this input ID Use a tool like firebug to investigate its id. Link to comment Share on other sites More sharing options...
vlkc Posted April 5, 2012 Author Share Posted April 5, 2012 OK i will try anotherway. How do i fill first input with text "test text"? Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted April 5, 2012 Administrators Share Posted April 5, 2012 document.getElementById('UrlFrame_id').contentWindow.document.getElementById('input_id').value="test text"; You must replace UrlFrame_id and input_id with proper real ids. Link to comment Share on other sites More sharing options...
vlkc Posted April 5, 2012 Author Share Posted April 5, 2012 document.getElementById('UrlFrame_id').contentWindow.document.getElementById('input_id').value="test text"; You must replace UrlFrame_id and input_id with proper real ids. How to do this on Unibutton1.click ? Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted April 5, 2012 Administrators Share Posted April 5, 2012 How to do this on Unibutton1.click ? Server side: uses ...uniGUIAplication, procedure TMainForm.UniButton1Click(Sender: TObject); begin UniSession.AddJS(' your JS code'); end; Client side: function OnClick(sender, e) { your code here } See our demos for client side scripting. Link to comment Share on other sites More sharing options...
vlkc Posted April 5, 2012 Author Share Posted April 5, 2012 I have an UrlFrame with the id "myUrlFrame" and a "div" on it with the name "myTile3". To get the text of this element, I use the following code: document.getElementById('myUrlFrame').contentWindow.document.getElementById('myTile3').firstChild.data; But the server and port must be exactly the same; Browsers deny access for security reasons, if you use another servername or port. Is there another way to open up the website and put text into input? without restrictions... Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted April 5, 2012 Administrators Share Posted April 5, 2012 Is there another way to open up the website and put text into input? without restrictions... What is your purpose for doing this? Why users simply don't type into those fields? Link to comment Share on other sites More sharing options...
vlkc Posted April 5, 2012 Author Share Posted April 5, 2012 What is your purpose for doing this? Why users simply don't type into those fields? Purpose is automaticaly fill and read web forms. In delphi the is a component Twebbrowser which perfectly does this work. there is only one problem, not all of users are using Windows. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now