Class FormSubmitCommand

java.lang.Object
com.oorian.messaging.commands.Command
com.oorian.messaging.commands.FormSubmitCommand

public class FormSubmitCommand extends Command
Command to programmatically submit an HTML form.

This command triggers the submission of a form element, causing all form data to be sent to the server as if the user had clicked a submit button. This is useful for automated form submissions and workflow automation.

Features:

  • Programmatically submits HTML forms
  • Triggers form validation
  • Targets specific forms by ID
  • Supports automated workflows

Usage:


 // Submit a form programmatically
 FormSubmitCommand submit = new FormSubmitCommand("loginForm");
 JsonObject json = submit.toJson();
 
Since:
2007
Version:
1.0
Author:
Marvin P. Warble Jr.
See Also:
  • Constructor Details

    • FormSubmitCommand

      public FormSubmitCommand(String formId)
      Constructs a new FormSubmitCommand to submit the specified form.
      Parameters:
      formId - the ID of the HTML form to submit
  • Method Details

    • toJson

      public JsonObject toJson()
      Generates the JSON representation of this form submit command.

      The JSON includes the command ID and form ID.

      Specified by:
      toJson in class Command
      Returns:
      a JsonObject containing the form submit command attributes