B4J Question WebApp - Get form-data with a websocket


Licensed User
I have a simple form in a web-page and when I click the submit button, I can see the values in webdev-tools in Chrome (network-tag).
I gave the form an ID and it triggers correctly in B4J but the map (Params) does not contain the values. It only contains values such as which=1, metaKey=false, pageY=268 etc).
How can I get values from the fields in my form in B4J so I can use them for further processing such as validation, entering data in a DB?
I am using WebSockets.


Staff member
Licensed User


Licensed User
Thanks, and it works fine.
We are really fortunate thanks to all the stuff Erel has built for us.

Erel's example is using a form to get a file. If you wish to get the values of a text field, checkbox, radio, dropdowns (select) etc from a form, then just use the method GetValue like below:

Public Sub GetFieldData(parts As Map)
    Dim myfielddata As Part = parts.Get("notes")
    'do something with the data
    ws.Flush 'this is a server event so we need to explicitly call Flush
End Sub