ggbApplet.getValueString("textObject") returns object value if text value is "object"

William Oakley shared this question 2 years ago
Needs Answer

I'm running into a minor issue with input boxes in geogebra. I've linked an example below.

I'm running a bit of javascript in the text objects associated with my input boxes to check for odd inputs and correct them back to a "?" in the event someone tries to enter odd strings which in some cases can create / change other objects on the canvas (what i'm trying to avoid).

When the name of an object is entered into one of these input boxes in quotations (as a string - "objectName") the script will actually pull the value of the named object and assign that value to the text object via the script. it will also parse some geogebra script if it's entered in the same way (try entering "x(A)" in the attached example).

I'm trying to find a way to prevent anything but a range of numerical entry or specific strings that correspond to correct answers. If anyone has any suggestions on how to improve this script or the method i'm using I would greatly appreciate the input.

Comments (1)


If you want to allow specific strings and numbers then you probably need to use

© 2022 International GeoGebra Institute