Reading and writing web forms

The MBS Plugin can be used to read and write web forms. There are two basic methods. The first is using the built in MBS functions to get and set specific HTML Elements. The second method is to use JavaScript to do the same thing. Although most of the time you can use the simple MBS functions, occasionally you need to use JavaScript.

Using the MBS Functions

There are several functions for getting the values of many of the most common elements.

Get the label of a button - WebView.GetFormButtonValue
Get the value of a text field - WebView.GetFormInputValue
Get the value of a text area - WebView.GetFormTextAreaValue
Get the value of a Select Element - WebView.GetFormSelectValue
Get the value of a Check Box - WebView.GetFormInputChecked

The Get Functions are all used the same way. For example here is the function that will return the value of a text field (html input element)

MBS("WebView.GetFormInputValue";
Web Viewer Object Name or Reference;
Form Name or Index;
Element Name or Index
)

Notice that you must have three pieces of information to set an html elements value.

  1. The name of the Web Viewer or its Reference as returned by the WebView.FindByName function
  2. The name of the Form or the its Index
  3. The name of the Element or its Index

Remember that the Index is zero based. So the First Item is always 0.

There are also a set of functions for setting the values of those same elements.

Set the label of a button - WebViewSetFormButtonValue
Set the value of a text field - WebView.SetFormInputValue
Set the value of a text area - WebView.SetFormTextAreaValue
Set the value of a Select Element - WebView.SetFormSelectValue
Set the value of a Check Box - WebView.SetFormInputChecked

The Set Functions are all used the same way. For example here is the function that will Set a value into a text field (html input element)

MBS("WebView.SetFormInputValue";
Web Viewer Object Name or Reference;
Form Name or Index;
Element Name or Index;
Value to Set
)




Links
MBS FileMaker Plugins