Source language: Translate to:

Validate TextBox

Questions about using NeoBook's scripting language

Moderator: Neosoft Support

Validate TextBox

Postby fuad007 » Mon May 02, 2011 6:41 pm

Hi Folks

i am doing a quiz in Neobook and in a textbox i dont know how to allow only "T" for True or "F" for false questions, if the user insert anything else a popup message appears telling "Insert only T or F"

Thanks in advance
fuad007
 
Posts: 5
Joined: Fri Apr 29, 2011 10:02 pm

Postby Gaev » Tue May 03, 2011 5:17 am

fuad007:

The Radio Button object is a better tool/object to use when you want to limit the user's choice to something like True and False.

However, if you must use a Text Entry Box ... you can place script in the Text Change section of this object that will ...

a) check the value of the Variable (to store Text Entry contents) e.g ...
Code: Select all
IfEx "[TextEntry1] <> T AND [TextEntry1] <> F"
.... error response here ...
EndIf

b) If invalid, popup an AlertBox or Balloon with the desired message e.g. ...
Code: Select all
AlertBox "Error" "Can only enter T or F"

c) set the Variable (to store Text Entry contents) to "empty" e.g. ...
Code: Select all
SetVar ""[TextEntry1]" ""
User avatar
Gaev
 
Posts: 3718
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Postby Pat Baner » Tue May 03, 2011 7:04 am

Do you have to use a text box? Try using 2 radio buttons. Put one as a "T" and one as a "F". For the variable, use the same variable in both. when the user selects his/her choice, the variable will contain the T or F.
Pat Baner
 
Posts: 75
Joined: Tue Jan 04, 2011 9:21 am

Thanks

Postby fuad007 » Wed May 04, 2011 10:58 pm

Thank you very much for your answers!!! :D :D :D :D :D
fuad007
 
Posts: 5
Joined: Fri Apr 29, 2011 10:02 pm


Return to NeoBook Action Commands

Who is online

Users browsing this forum: No registered users and 2 guests