The problem is to create a date-entry section on a form. Of course there's an easy way to do this, just use an ENTRY tag and deal with the result in your cgi script that handles the form. No problem, right? Right.
Here's something that's a bit different. It allows the entry via either pop-up menus or scrolling lists (which people using X windows may need to use if their font is too large to hold the 31 possible day numbers). The date entry are looks like this:
This was produced by a single line of htm4l code (centered in a FORM):
There is an equivalent m4_dmy macro which produces the identical thing, but in month, day, year order.
The arguments to the macro are as follows:
|Variable suffix||This is used as the suffix for the three name variables that will appear in the form's html. In the above example, the form will have variables arrival_month, arrival_month, and arrival_year. The program that processes your form should expect to deal with these variables as usual.|
|Font size||This is used in a <font size="X"> command that precedes the generated html. If you give a value of zero, no font size-changing html is issued.|
|Starting year||The first year you want to see in the list of selectable years.|
|Ending year||The last year you want to see in the list of selectable years.|
|Scroll size||This optional argument will cause htm4l to output html that makes each entry field a scrolling list rather than a popup menu. This variable determines how large each scrolling list is. In the above example, this argument is missing (see the next example though).|
The above example did not provide a 5th argument, and so htm4l generated html that presents popup menus to the user. Here is an example with a 5th argument to set the size, with day, month, year order, and also with a small font.
It won't come as any surprise to hear that this was produced with the single line
This is probably usable by a wider range of people, since it is pretty much guaranteed to fit on any screen. Putting that many lines into a popup menu is asking for trouble.
The html generated by this example looks like this:
You obviously get quite a bit of html for your one line of htm4l.
If you don't like the way this looks, that's fine, I'm not particularly fond of it either. But at least it gives you an idea of what is possible and can be a starting point for your own customized macro.