How can you make a VisualNeoWeb TextInput object a Required Entry? - Forum

Forum Navigation
You need to log in to create posts and topics.

How can you make a VisualNeoWeb TextInput object a Required Entry?

I can't find anything available to give a VisualNeoWeb textinput object a  required entry from the property inspector.   I have many textinput objects that are not in a form that require some user input.  What's the best method to add a required property to the textinput  objects?  Adding some code to each object when the user exits the field?

thanks!

@darbdenral

I have many textinput objects that are not in a form that require some user input.

What's the best method to add a required property to the textinput objects?

The answer depends on "the user action that requires use/access to the contents of the Text Input objects" ... if required when user ...

a) navigates to another page, you can check (place code) in the page's page-exit event section

b) click/taps a Push Button or similar object, you can check in that object's click/change event section

 

If none of the above, perhaps you can provide more details of your App's use of these Text Input values.

Adding some code to each object when the user exits the field?

That may not always work because the user may NEVER navigate to this object.

@darbdenral, as @gaev says there are many ways to solve this.
The traditional HTML "required" property can be set adding this code to the page "Code" tab, where your Text Input object is located:

SetObjectAttribute "TextInput1" "required" "required"

It will work if your Text Input object is inside a Form object.
Whenever you press the "Submit" button it will check for any content within the Text Input before sending the form information to the server.
Of course you can check the Text Input content through scripting too.

 

Yes, I solved this with a function specific to my app..

Thank you very much again for help