PDF Dropdowns & FDF

The code covered thus far in this article ensures that we can populate text fields on the form with data provided from the Server Side in response to a form submission, but what about if our data is in a drop down list ?

Drop down lists are very similar, but require a few additional functions as follows :

rem this sub creates the top of a drop down object
sub startDropDown(ddname,defaultValue)
    Response.Write("<<" & CRLF & "/T (" & ddname & ") " & CRLF & "/V (" & defaultValue & ") " & CRLF & "/Opt [(" & defaultValue & ")")
end sub
 
rem this sub adds a value to the drop down list
sub addDropDownValue(DDValue)
    Response.Write("(" & DDValue & ")")
end sub
 
rem this sub closes the Drop down object
sub endDropDown()
    Response.Write("]" & CRLF & ">>" & CRLF)
end sub

Thus a call to populate a dropdown list called ordertype with value 1, 2 and 3 with the first one being the default value, would look something like the following :

call startDropDown("ordertype","1")
call addDropDownValue("2")
call addDropDownValue("3")
call endDropDown()

The amended Customer Order Form can be found here.

In the next section we will look at the role that Javascript can play and the additional functionality that is offered in the PDF implementation of Javascript.