| |
 |
Hotline Question of the Month |
| by Margaret Jeronim |
|
| |
Question: I am trying to create a Web/CGI maintenance application over a simple file.
I have a field representing a document name, which can be one of a few possible entries. I am using the "LS" validity check feature for this field so that the user will select one of several choices from a drop down list.
After I created the app, the field showed up as a TEXTAREA, and not a drop down list.
I compared this to other apps that I have created before using this feature and am doing this exactly the same way. Why is this happening?
|
Answer:
<TEXTAREA> tags show up for fields which are defined in your file as alpha fields and are more than 50 characters long. Since the field that you're using is defined as 60 alpha, <TEXTAREA> is automatically displayed. This is the default. See Figure 1 that shows a maintenance application that consists of 3 fields: Ref Name, Doc Name, and LS50. Ref Name that is defined as 10 Alpha (10 characters long), Doc Name is defined as 60 alpha and LS50 is defined as 50 alpha field. The objective is to have your Doc Name displayed same way as LS50 (a drop-down list).
Figure 1 (Click to enlarge)

You can modify the html for that application. This is what the original html looks like when you generate the application. Text in red represents the Doc Name field.
<P>
<table border=0 cellpadding=0 cellspacing=0> <tr> <td class="nine">
<TABLE border="0" cellspacing="1" cellpadding="1">
<TR><TD class="one"><strong>RefName </strong></TD>
<TD><INPUT size=010 maxlength=010 type="text" name="K001" value="@K001">
</TD></TR>
<TR><TD class="one">Doc Name </TD>
<TD><TEXTAREA name="K002" cols=040 rows=5 wrap=physical>@K002</TEXTAREA>
</TD></TR>
<TR><TD class="one">LS50 </TD>
<TD><script>setList('XXX','show','K003',"@K003",parseInt('003',10)-1," ","="); </script>
</TD></TR>
Note that this field - Doc Name - @K002 is between <TEXTAREA> </TEXTAREA> tags. To display that field as a regular, drop-down list, the following modifications need to be done (see text in red):
<P>
<table border=0 cellpadding=0 cellspacing=0> <tr> <td class="nine">
<TABLE border="0" cellspacing="1" cellpadding="1">
<TR><TD class="one"><strong>RefName </strong></TD>
<TD><INPUT size=010 maxlength=010 type="text" name="K001" value="@K001">
</TD></TR>
<TR><TD class="one">Doc Name </TD>
<TD><script>setList('XXX','show','K002',"@K002",parseInt('002',10)-1," ","="); </script>
</TD></TR>
<TR><TD class="one">LS50 </TD>
<TD><script>setList('XXX','show','K003',"@K003",parseInt('003',10)-1," ","="); </script>
</TD></TR>
See Figure 2 for a view from the browser of this modified application.
Figure 2 (Click to Enlarge)

Or, if you always want to display alpha fields that are longer than 50 characters as drop-down list, you can modify the template directly. That change would affect all of your Web/CGI maintenance applications.
Have a hotline question of your own? Send an e-mail to support@mrc-productivity.com and let our product specialists help you!
|
|
 |
mrc publishes this newsletter on a monthly basis. Subscription is free of charge. Please send any questions or comments about this newsletter to news@mrc-productivity.com. This newsletter is edited by Heather Gately.
To unsubscribe, please just reply to this e-mail with Unsubscribe in the subject line.
View our privacy promise.
|
 |
|