Daniel Lourenço wrote:
Can you please send us an example oml because i have tried it many times but is not working with me
Ahmed Gad wrote:
The input is updated but the local variable is still the same. You have to trigger it the second time for the local variable value to be updated.
Regards,
"var r = confirm(""Text""); if (r == true) { " + Input.Id + ".value = 1; } else { " + Input.Id + ".value = 0; }"
Hi,
I'm trying to use this logic to get a random number to be passed into a web service and the page be refreshed by Javascript. I can do it through Ajax refresh but the Javascript bit is tricky.
I am able to output the random numbers into text boxes by Javascript, however I am only able to show them not manipulate them.
I've tried passing the typed value into a function (which simply doubles it).
My random number is put into a text input box by this javascript.
I imagine I am doing something really daft, as this article did make a lot of sense, and helped me get started. However, I have reached a bit of a roadblock. Any ideas?
SyntaxEditor Code Snippet
document.getElementById("RichWidgets_wt3_block_wtMainContent_wtLatestRandomNumber").value = answer;
I have this in my onclick of a navigate button (which goes to "#") for the External URL
"document.getElementById('" + Average1.Id + "').value = '"+DoubleMe("document.getElementById('"+LatestRandomNumber.Id+"').value")+"';"
In case you want an example, I had to pass a Javascript variable into an application variable to verify that the user clicks the "I am not a Robot" captcha.This module is dependent on the New reCAPTCHA.Disclaimer: This module does not properly/securely verify the captcha click. It uses a workaround, grecaptcha.getResponse().
Hi Everyone,
Can someone point me to a post wherein the Local Variable of a Web Screen can be used in a Javascript (with sample code).
Thank you and regards,
Christopher
function addTwoJavascriptfields(id1, id2, id3, id4) { var fieldOne = document.getElementById(id1).value; //gets from Input var fieldTwo = document.getElementById(id2).value; //gets from Input var sum = parseInt(fieldOne) + parseInt(fieldTwo); document.getElementById(id3).value = sum; //places in an Input box document.getElementById(id4).innerHTML=sum; //places in an expression }
This Outsystems platform promises "fast quick build application time" when passing a Javascript function return object/variable to an outsystem local variables takes you days to figure out which the "normal way of programming" can do straightforwardly in minutes. I wonder how many skeletons in Outystem's closet is still hiding.
I agree, it's not obvious or straightforwards... but it does NOT take "days to figure out", especially when sample code abounds in the forums and forge, and there are plenty of people (myself included) who would be happy to spend a few minutes on a screenshare showing you how to do it.
J.Ja
Justin James wrote:
That's comforting to know @JustinJames. I figured that one way to pass value from JS script to Outsystem's local variable is to use FakeNotifyWidget and inside it the NotifyGetMessage. Do you have other solution as well?
Rey Anthony Renacia wrote:
Hi Rey Anthony Renacia,
Please refer the below link:
https://www.outsystems.com/forums/discussion/40098/how-to-assign-javascript-value-to-out-system-local-variable/
Hope it helps.
Kind Regards,
Benjith Sam
Thanks man, this is helpful
HI,
I have to assign a js variable value to input widget local variable and should give a ajax refresh for the container. I'm able to trigger the ajax refresh but unable to pass the value. when i debug , in the inspect mode im unable to see the assigned variable.Please help me , how to fix this issue.