Need help hiding input box under certain circumstances (user input must be specific format)

Anirudh Venkataramanan shared this question 5 months ago
Needs Answer

I have an input box called InputBox1. The user input is stored in a text box called text19. The user input is also parsed into a numeric variable called ans1.

So if the user inputs "25", text19 becomes a string "25" and ans1 becomes 25.

I want the input box to disappear when the user input is 235. The answer could be inputted as 235, or 235.0, or 235.0000000000000000000000000000.

However, there can be no arithmetic signs in the user input. If the user types 230 + 5 or 240 - 5, the input box should not disappear.

Right now, the 'Condition to show Object' script is as follows -

ans1 ≠ 235 ∨ IsDefined(IndexOf("+", text19)) ≟ true ∨ IsDefined(IndexOf("-", text19)) ≟ true ∨ IsDefined(IndexOf("*", text19)) ≟ true ∨ IsDefined(IndexOf("/", text19)) ≟ true

The script basically just changes the texts' color based on the validity of the answer.

Please let me know how I can fix the above 'Condition to show Object' script.

Comments (1)

photo
1

do you mean Length(TextToUnicode(text19) \ TextToUnicode("235.0"))>0

© 2019 International GeoGebra Institute