/ Forums / Advansys Formativ / Creating Solutions with Formativ / Getting data from HTML forms – newbie question / Reply To: Getting data from HTML forms – newbie question

#6691
Support 1a
Participant

The FormVariables object only returns the values from Formativ Portals – not HTML dialogs. I think there may be an error in the documentation in this regard.

You need to use the aDlg.Variables object, which is very similiar to the FormVariables object. We have updated your code to show how this works.

Advansys Support

Sub Main(Client, GWEvent)
 
  Dim aDlg 
  dim iHtmlCtl
  dim iLastName
 
  Set aDlg = Utilities.NewHTMLDialog 
  aDlg.Caption = "New Account Request Form" 
  aDlg.HTMLCode = Utilities.LoadStringFromFile(Utilities.GetDataDirectory & "test.htm")
  aDlg.Execute
  
  ' Returns variables and its values set by HTML form controls in the dialog
  set iHtmlCtl = aDlg.Variables.ItemByName("txtLastName")
  if not iHtmlCtl is nothing then
    iLastName = iHtmlCtl.Value
  end if  
  
  Dim Msg
  GroupWise.NewMail
  Set Msg = GroupWise.ComposingItem
 
  if Msg is Nothing then
    MsgBox("No composing item available")
  else
    Msg.BodyText = iLastName
    Set Msg = nothing
  end if
 
  
End Sub