Having 2 input fields and 1 button, how can i add 2 given numbers and show the result when the user clicks on the button ? The point is, I have no clue how to read those 2 values from the input fields. Could anybody please give me a hint ?
Having 2 input fields and 1 button, how can i add 2 given numbers and show the result when the user clicks on the button ? The point is, I have no clue how to read those 2 values from the input fields. Could anybody please give me a hint ?
Thanks for your help, Max. So my next question would be: when will it be possible to add such a javascript function ?
To be honest, I don't have a time frame for this feature yet. But, please create a new issue and set it as Idea so you can track its progress.
So, if I want to send the user to a webpage, and have the URL contain some variables from storage, it cannot be done? For instance, create a google search?
If still not available, was this created as idea? I would like to vote.
Thanks Max, will try and edit this post if failed.
Edit:
Ok, I am still lost....
For the sake of simplicity, lets just say I want to do a Google search (input+button) that will open the result in a browser.
Created input, called it "query"
Created Rest service, with the Google URL, and with the "q" parameter.
Mapped the "q" parameter to the "query" input field.
Created a button that invokes the service.
Now, I cannot figure out how to make this service open a webpage.
P.S.
I thought services are NOT intended to be used like this, but rather be web services to fetch data from RESTful APIs.
I thought I should use the simple event action "Open a Link" or Run Custom Javascript to do this.
What am I missing?
I'm not sure that will work, I tried https://www.google.com/?q=test but it didn't work, it wants me to click on Search button. Google does have search REST API, so you probably want to use that.
Thanks Max,
The proper way to call a google search result page is
https://www.google.com/search?q=test
But in any case, this was only an example to demonstrate what I want to do, which is:
Grab parameters from either an input field, or a local store
On a button click, open a web page using a URL that uses these parameters.
For my need, imagine that the user enters his age and gender, and clicks "Go" and I open a page on my website that uses this data.
This, in my opinion is a basic functionality that must be available.
I am surprised that on one hand you have such nice and deep functionality, such as the entire REST service handlers, and on the other hand, storage variables and form fields cannot be accessed by most features.
For instance, if these variables would have been accessible to a custom javascript, and the custom javascript could use a command to invoke the web browser on a specific page, this functionality could have been available.
Another approach I was thinking about, is to make the "Open a Link" action accept inline arguments, so for example I could use:
http : / / google.com/search?q=[NameOfInputField.text]
as a generic syntax to access attributes from other places of the application.
Got it, here is how to do it:
Check out this app: http://gotiggr.com/preview/21674/.
The input field is named 'search'.
The button has custom JavaScript that looks like this:
code
var s = Tiggr('search');
window.open('https://www.google.com/search?q='+s.val(), 'NewWindow', 'width=600,height=400,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes,resizable=yes');
/code