webMathematica > Formatting >

HTMLSelect

HTMLSelect[options, name]
returns an HTML select tag with the given set of options HTMLSelect[options, name, default]
sets the default
  • The HTML functions are contained in a package, MSP`HTML`, which is loaded as part of the webMathematica layout.
  • The function HTMLSelect provides a useful way to generate select tags with webMathematica.
  • It is also possible to set selections by using the option SelectedOptions.
  • HTMLTableForm takes the following options.
SelectedValuesinitial selection based on values
SelectedOptionsinitial selection based on options
OptionAttributesattributes to apply to the HTML select tag
You can demonstrate how the function works by loading the package.
In[1]:=
Click for copyable input
The function HTMLSelect provides a useful way to generate select tags with webMathematica. It takes a list of the different options and the name to be used when the selection is submitted. Its operation is shown below.
In[2]:=
Click for copyable input
Out[2]=
It is also possible to set selections by using the option SelectedOptions. In this example, the option labeled "a" will be selected.
In[3]:=
Click for copyable input
Out[3]=
By default, the values for the option tags are chosen automatically. It is also possible to set these with an argument.
In[4]:=
Click for copyable input
Out[4]=
The option SelectedValues can be used to set a selection based on the values.
In[5]:=
Click for copyable input
Out[5]=
The selection options can take a list of values to set a multiple selection.
In[6]:=
Click for copyable input
Out[6]=
If no values are given, the SelectedValues option can use the numerical values.
In[7]:=
Click for copyable input
Out[7]=