Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi guys,
simple problem:
How can I access the result of a formurla with JavaScript?
How can I get the content of a Textbox? (The result of the formurla is in a Textbox)
I tried this three things:
1. I put the formula in a variable and read the variable in JavaScript-> gives me the formular but not the result
2. I tried to get the the content of the Textbox -> no success (but works with Listboxes)
3. I tried to access the html directly with "document.getElementsByTagName("td")" and then get the value -> no success
can someone help me please?
Hi,
I have no idea concerning JavaScript - but you said it works with listboxes ((you can get the contents) - then why don't you just create a listbox (also in the "new object" menu) - I guess you don't even have to display it - and put the formula there, just like you did in the textbox - with that $() expansion syntax to get the result of the formula rather than its text.
HTH
Best regards,
DataNibbler
I guess your first option should work. May be, there is a missing '=' in your variable definition. Try variable defition with a preceding '=' sign.
yes that would work,
but I have more than one textbox and would have to create one listbox per textbox, so gets a little bit messy
I thinks this is not a fine solution
i tried different things:
Nr 1 is working gives me the current User
Nr. 2 not working, after load script the variable is not avaiable, I don' t know why
Nr. 3 same as Nr.2
Nr. 4 give me only the string
Nr. 5 same as 4
so why is Nr. 1 working and Nr. 2 not?
Rather try like:
Input:
Load * Inline [
Summand, Summand2
123, 1000
20, 100];
Tab1:
Load
Sum(Summand) as SumA
resident Input;
Let LetFORMEL_1=Peek('SumA');
If using vbscript macro's there is an evaluate function which will calculate the result of an input string such as your variable. Presume same or similiar in javascript.
thanks a lot this is working!
Edit:
Problem:
If I make a selection then the formurla is not calculated
You have to define your variable in the front-end. Settings->Variable Overview. And there, the simple definition would be like:
=Sum(Summand)
the problem is still there:
I want the value of the formula with current selection in the JavaScript-Extension