Specifying "prompt values" and "help text" on an O4WTextbox (Web)

 

For example, let's say we have a textbox that's supposed to take the port number of the engine server:

                                O4WTextbox(value, "", "", "PORTNO" , "PORTNO")

We can put in, as the prompt, the default value - in this case, it shows the user what value we will use even if they leave it blank - and we can spell out in more detail what we are looking for in the help text.  Our new code will look like this:

                                helpText = "Enter an available tcp/ip port for normal connection requests (default 8088)"

                                promptText = "8088"

                                O4WTextbox(value, "", "", "PORTNO", "PORTNO",  O4WInputBoxOptions("number", "", "", "", promptText):O4WHelpStyle("", helpText))

We use O4WInputBoxOptions to specify the prompt, and O4WHelpStyle to specify the help text.

(Notice that we have specified, as parameter #1 to the O4WInputBoxOptions, "number" - this means we are telling the browser to expect a number, and different browsers might use this information in different ways.  For example, some browsers on mobile phones will pop up a special numeric keyboard if they see this, while others might disallow any non-numeric entry.)

 

Note that the O4WHelpStyle can be applied to almost _anything_ - not just textboxes, but also items in a listbox, radio buttons, checkboxes, even plain text, headers, etc.  Prompt text, only applies to textboxes.

  • kb/kb_articles/kb1015.txt
  • Last modified: 2024/01/30 13:36
  • by 127.0.0.1