Put text into fld at a website
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Livecode Opensource Backer
Put text into fld at a website
Hello,
I have my mozilla firefox browser with an simple website with the following code:
<HTML>
<HEAD>
<TITLE>My website</TITLE>
</HEAD>
<BODY>
<textarea id="output-field"></textarea>
</BODY>
</HTML>
At this website there only is a textarea with the id "output-field".
Now I have my simple livecode programm with just one push button. If I push the button I want it to put the text "Hello World" into the field "output-field" at my website.
Is this possible?
Best Regards
User87
I have my mozilla firefox browser with an simple website with the following code:
<HTML>
<HEAD>
<TITLE>My website</TITLE>
</HEAD>
<BODY>
<textarea id="output-field"></textarea>
</BODY>
</HTML>
At this website there only is a textarea with the id "output-field".
Now I have my simple livecode programm with just one push button. If I push the button I want it to put the text "Hello World" into the field "output-field" at my website.
Is this possible?
Best Regards
User87
Re: Put text into fld at a website
Hi User87,
Yes this is possible by executing some Javascript on the webpage. You should be able to use something like-
You will need to change the "1" above to reflect your LiveCode browser instance.
Kind Regards,
Neil Roger
--
LiveCode Support Team ~ http://www.livecode.com
--
Yes this is possible by executing some Javascript on the webpage. You should be able to use something like-
Code: Select all
get revBrowserExecuteScript(1, "document.getElementById('output-field').value = 'value'")
Kind Regards,
Neil Roger
--
LiveCode Support Team ~ http://www.livecode.com
--
-
- Livecode Opensource Backer
Re: Put text into fld at a website
Hi Neil,
thanks for your response.
Where do I get my browser ID to replace it with "1" in your example?
I use Mozilla Firefox.
thanks for your response.
Where do I get my browser ID to replace it with "1" in your example?
I use Mozilla Firefox.
-
- Livecode Opensource Backer
Re: Put text into fld at a website
To make shure you understand me.
I do not use the revBrowser in livecode.
I use Mozilla Firefox (with the website which is already open)
And in addition to that I use my livecode programm with the push button on it.
It's both seperate in use.
I do not use the revBrowser in livecode.
I use Mozilla Firefox (with the website which is already open)
And in addition to that I use my livecode programm with the push button on it.
It's both seperate in use.
Re: Put text into fld at a website
Hi User87,
The browser ID is returned after you create a browser instance via revBrowserOpenCef. An example of this can be found here-
http://lessons.livecode.com/m/2592/l/27 ... n-your-app
Any created browser instance IDs can also be returned by function revBrowserInstances.
From your last response, it looks as though you are trying to enter text in an external browser (not one created in LiveCode). This is not something that is directly possible but you may be able to set your server/site up to accept POST/GET parameters which your can fire from a LiveCode app.
Kind Regards,
Neil Roger
--
LiveCode Support Team ~ http://www.livecode.com
--
The browser ID is returned after you create a browser instance via revBrowserOpenCef. An example of this can be found here-
http://lessons.livecode.com/m/2592/l/27 ... n-your-app
Any created browser instance IDs can also be returned by function revBrowserInstances.
From your last response, it looks as though you are trying to enter text in an external browser (not one created in LiveCode). This is not something that is directly possible but you may be able to set your server/site up to accept POST/GET parameters which your can fire from a LiveCode app.
Kind Regards,
Neil Roger
--
LiveCode Support Team ~ http://www.livecode.com
--
-
- Livecode Opensource Backer
Re: Put text into fld at a website
Yes it is a external browser.
The website in which I want to past text (in the textfield at the website) is not my website. I can not change the website due to the POST/GET parameters.
Therefore I am afraid it is not possible what I want to do?
The website in which I want to past text (in the textfield at the website) is not my website. I can not change the website due to the POST/GET parameters.
Therefore I am afraid it is not possible what I want to do?

Re: Put text into fld at a website
Is there any reason you cannot create a browser instance in your app and fill in the text box that way?
Kind Regards,
Neil Roger
--
LiveCode Support Team ~ http://www.livecode.com
--
Kind Regards,
Neil Roger
--
LiveCode Support Team ~ http://www.livecode.com
--
-
- Livecode Opensource Backer
Re: Put text into fld at a website
Yes. The website only is used with Mozilla Firefox the whole time.
Maybe if I use the livecode browser intance something will not work on the website.
Maybe if I use the livecode browser intance something will not work on the website.
Re: Put text into fld at a website
The latest LiveCode browser instances use the Chromium Embedded framework which is a very modern and up-to-date embedded browser engine.
Many applications use this so I would suggest testing this your website as you may find it equally comparable to the FireFox browser.
A list of application that use CEF can be found here-
https://en.wikipedia.org/wiki/Chromium_ ... _using_CEF
Kind Regards,
Neil Roger
--
LiveCode Support Team ~ http://www.livecode.com
--
Many applications use this so I would suggest testing this your website as you may find it equally comparable to the FireFox browser.
A list of application that use CEF can be found here-
https://en.wikipedia.org/wiki/Chromium_ ... _using_CEF
Kind Regards,
Neil Roger
--
LiveCode Support Team ~ http://www.livecode.com
--
-
- Livecode Opensource Backer
Re: Put text into fld at a website
Another issue is that i normally use 20-30 tabs at the same time in firefox.
You think a livecode programm would be fast and stable enough to handle this?
And also is it possible to install browser add ons to the livecode browser? This is very important I use DownThemAll as add on in firefox.
You think a livecode programm would be fast and stable enough to handle this?
And also is it possible to install browser add ons to the livecode browser? This is very important I use DownThemAll as add on in firefox.
-
- Livecode Opensource Backer
Re: Put text into fld at a website
Now I made a livecode app with the browser instance. But the Standalone Application doesn't work with windows 10.
No browser is created.
In livecode itself it works.
I exactly did what is said in this tutorial: http://lessons.livecode.com/m/2592/l/27 ... n-your-app
You have any idea why the Standalone does not work?
No browser is created.
In livecode itself it works.
I exactly did what is said in this tutorial: http://lessons.livecode.com/m/2592/l/27 ... n-your-app
You have any idea why the Standalone does not work?
Re: Put text into fld at a website
Tabs are not supported neither are browser addons so that is one element you would have to create manually (e.g. multiple browser instances for tabs)
In regards to the browser instance, what version of LiveCode are you using? It could be that the required inclusions are not being automatically set.
To resolve this, check the Browser (CEF) option from your apps standalone settings as this will manually included the required script library.
Kind Regards,
Neil Roger
--
LiveCode Support Team ~ http://www.livecode.com
--
In regards to the browser instance, what version of LiveCode are you using? It could be that the required inclusions are not being automatically set.
To resolve this, check the Browser (CEF) option from your apps standalone settings as this will manually included the required script library.
Kind Regards,
Neil Roger
--
LiveCode Support Team ~ http://www.livecode.com
--
Re: Put text into fld at a website
To your info into an existing web page do the following.
This is a working example on my site for you to test with.
in a button add this
on mouseUp
put urlEncode(fld "Email") into tEmail
launch URL "http://2108.co.uk/code/php/temp/form.php?Email="& tEmail
end mouseUp
Then you need a php page which will include your form and the code to collect the data from LC
<?php
if(isset($_GET['Email'])) $var=$_GET['Email'];
?>
<form action="http://2108.co.uk/code/php/temp/form.php" method="POST">
<input type='text' name='var' value="<?php echo "$var";?>" />
</form>
This is a working example on my site for you to test with.
in a button add this
on mouseUp
put urlEncode(fld "Email") into tEmail
launch URL "http://2108.co.uk/code/php/temp/form.php?Email="& tEmail
end mouseUp
Then you need a php page which will include your form and the code to collect the data from LC
<?php
if(isset($_GET['Email'])) $var=$_GET['Email'];
?>
<form action="http://2108.co.uk/code/php/temp/form.php" method="POST">
<input type='text' name='var' value="<?php echo "$var";?>" />
</form>
Andy .... LC CLASSIC ROCKS!
-
- Livecode Opensource Backer
Re: Put text into fld at a website
Hello,
@Neil:
Thanks it works
. Now I has to figure out how to add the tab navigation and how to open links via contect menu with right click.
@Andi:
Thank you for your help.
The problem is I can not change the web site to add the code on it. It is not my website.
Imagine I would put the text in the search field at www.google.de
If you has any ideo how to solve this problem you can tell me
@Neil:
Thanks it works

@Andi:
Thank you for your help.
The problem is I can not change the web site to add the code on it. It is not my website.
Imagine I would put the text in the search field at www.google.de
If you has any ideo how to solve this problem you can tell me

-
- VIP Livecode Opensource Backer
- Posts: 10052
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Put text into fld at a website
Do you want to display the value in the browser, or is the goal to submit that value to the server?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn