List<ElementEntity> elementEntities = new ArrayList<>();
//here we have created the object to display the TextInput into the form
TextInputElement textInputElement1 = new TextInputElement("element1", "Name");
TextInputElement textInputElement2 = new TextInputElement("element2", "Last Name");
TextInputElement textInputElement3 = new TextInputElement("element3", "Address");
textInputElement3.setMaxLines(5);
elementEntities.add(textInputElement1);
elementEntities.add(textInputElement2);
elementEntities.add(textInputElement3);
//here we have created the navigation action which will executated on a click of button
URLNavigationAction urlNavigationAction = new URLNavigationAction("https://www.cometchat.com/");
ButtonElement submitElement = new ButtonElement("idSubmit", "submit", urlNavigationAction);
submitElement.setDisableAfterInteracted(true);
FormMessage formMessage = new FormMessage(receiverId, receiverType, elementEntities, submitElement);
formMessage.setTitle("Socity Survey");
formMessage.setAllowSenderInteraction(true); // this will confirm if sender can interact with that form or not