<% ' ===================================================================================== ' = File: incForm.asp ' = File Version: 5.1 (beta) ' = Copyright (c)1997-2003 American Web Services, Inc. All rights reserved. ' = Description: ' = Email, HTML Form and Database utilities ' = Revision History: ' = 14jul2000 (5.1 beta) ssutterfield: general code cleanup/documentation ' = Description of Customizations: ' = ' ===================================================================================== ' Short-cuts ' -------------- TextInput ------------------ Public Sub TextInput(ByVal strName, ByVal intSize, ByVal intMaxSize, ByRef rstDefault) Call FormInput("text", strName, strName, intSize, intMaxSize, rstDefault, "") End Sub ' -------------- PasswordInput ------------------ Public Sub PasswordInput(ByVal strName, ByVal intSize, ByVal intMaxSize, ByRef rstDefault) Call FormInput("password", strName, strName, intSize, intMaxSize, rstDefault, "") End Sub ' -------------- HiddenInput ------------------ Public Sub HiddenInput(ByVal strName, ByRef rstDefault) Call FormInput("hidden", strName, strName, 0, 0, rstDefault, "") End Sub ' -------------- TextArea ------------------ Public Sub TextArea(ByVal strName, ByVal intRows, ByVal intCols, ByRef rstDefault) Call FormInput("textarea", strName, strName, intRows, intCols, rstDefault, "") End Sub ' -------------- RadioButton ------------------ Public Sub RadioButton(ByVal strName, ByVal strValue, ByRef rstDefault) Call FormInput("radio", strName, strValue, 0, 0, rstDefault, "") End Sub ' -------------- CheckBox ------------------ Public Sub CheckBox(ByVal strName, ByVal strValue, ByRef rstDefault) Call FormInput("checkbox", strName, strValue, 0, 0, rstDefault, "") End Sub ' -------------- FormInput ------------------ ' Standard FORM INPUTs with default from Recordset ' strType: text, hidden, password, textarea, radio, checkbox ' strName: Form item NAME and visible value of form item ' strValue: Hidden value of form item ' intSize1, intSize2: "Size, Maxlength" or "Rows, Cols" ' rstDefault: Request or Recordset with default values ' strDefault: if not empty, overrides rstDefault Public Sub FormInput(ByVal strType, ByVal strName, ByVal strValue, ByVal intSize1, ByVal intSize2, ByRef rstDefault, ByVal strDefault) Dim strCheckedName strCheckedName = strDefault & "" If strDefault = "" then if IsObject(rstDefault) then strCheckedName = rstDefault(strName) & "" else strCheckedname = rstDefault & "" end if strCheckedName = Server.HTMLEncode(strCheckedName) End If Select Case strType Case "textarea" Response.Write "" Response.Write strCheckedName Response.Write "" Case "radio", "checkbox" Response.Write "" Case Else ' text, hidden, password Response.Write "" End Select End Sub ' -------------- ArrayPulldown ------------------ ' for backwards compatibility Public Sub ArrayPulldown(strName, strFirstOption, rstDefault, dctContent) Call FormMultiDct(strName, strName, 0, strFirstOption, "", rstDefault, dctContent) End Sub ' -------------- Pulldown ------------------ ' for backwards compatibility Public Sub Pulldown(strName, strValue, strFirstOption, strLabel, rstDefault, rstContent) Call FormMultiRS(strName, strValue, 0, strFirstOption, strLabel, rstDefault, rstContent) End Sub ' -------------- FormMultiRS ------------------ ' Standard SELECTs with default from Recordset ' strName: Form item NAME ' strValue: field name in rstContent for form item VALUE ' intSize: 0 = Pulldown, 1-n = Multibox ' strFirstOption: optional first OPTION (if selected, will have a value of "") ' strLabel: field name in rstContent for form item label ' rstDefault: Request or Recordset with default values ' rstContent: Recordset with content of pulldown/multibox Public Sub FormMultiRS(ByVal strName, ByVal strValue, ByVal intSize, ByVal strFirstOption, ByVal strLabel, ByRef rstDefault, ByRef rstContent) Dim strCheckedValue strCheckedValue = "" If Not IsNull(rstDefault(strName)) Then strCheckedValue = CStr(rstDefault(strName)) End If rstContent.MoveFirst ' Set rstTemp = rstContent.Clone Response.Write "" & vbcrlf If Not (strFirstOption = "") Then Response.Write "