viewer.setDefaultFilenameAdded by IBM on October 10, 2012 | Version 1 (Original)
|Sets the default file name of a form, unless they are temporary files. A form is considered temporary if it is passed to the IBM® Forms Viewer by the Web browser in response to a Web transaction. Temporary files have no default filenames.
Use this function when you are using the same form many times, and you want to uniquely identify each copy of the form based on who completed it and when it was filled out. For example, you might create a new file name based on the user name and the date.
Table 1. viewer.setDefaultFilename parameters
|units||String||The new default file name for the form. This string should not include path information.|
You must use the event model, such as keypress or mouseover events or the toggle function, to trigger the setDefaultFilename function. If you want setDefaultFilename to run when the form opens, toggle the function off of the value of the global.global.activated option. This option switches to on when the form is opened.
Example In this example, setDefaultFilename is used when the save button is clicked. Note that this example also uses the toggle function.
When the button is clicked, the default file name is set to be "myform< date
<button sid = "save_BUTTON">
(save_BUTTON.activated) == '1' ? viewer.setDefaultFilename(
'myform' +. date()) : ''"></custom:filenameSet_Option>
". For example, if the form was saved on September 13, 2007, the file name would be set to "myform20070913".