WEB READNEXT FORMFIELD

Retrieve next name-value pair in an HTML form.

WEB READNEXT FORMFIELD

Read syntax diagramSkip visual syntax diagramWEBREADNEXTFORMFIELD( data-area)NAMELENGTH( data-area)VALUE( data-area)VALUELENGTH( data-area)

Conditions: ENDFILE, INVREQ, LENGERR

This command is threadsafe.

Description

WEB READNEXT FORMFIELD retrieves the next name-value pair in an HTML form.

The data is returned in its unescaped form (see Reserved and excluded characters for an explanation of this).

Options

FORMFIELD(data-area)
Specifies the buffer to contain the name of the form field being retrieved. The case of the name is as it is stored in the form.
NAMELENGTH(data-area)
Specifies the length, as a fullword binary value, of the form field name. The actual length of the name is returned in this data area.

If the length of the form field name is less than the size of the buffer, the form field name is placed in the leftmost byte positions.

If the form field name exceeds the buffer, a LENGERR condition is raised and the name is truncated. The next execution of WEB READNEXT FORMFIELD returns the same field that caused the LENGERR condition. Ensure to use a buffer that is large enough to contain the name.

VALUE(data-area)
Specifies the buffer to contain the value corresponding to the name returned in the FORMFIELD data area. CICS® unescapes any escaped characters before placing them in the buffer.
VALUELENGTH(data-area)
Specifies the length, as a fullword binary value, of the form field value. The actual length of the value is returned in this data area.

If the length of the form field value is less than the size of the buffer, the form field value is placed in the leftmost byte positions.

If the value exceeds the buffer, a LENGERR condition is raised and the value is truncated. The next execution of WEB READNEXT FORMFIELD returns the same field that caused the LENGERR condition. Ensure to use a buffer that is large enough to contain the value.

Conditions

20 ENDFILE
The end of the list of name-value pairs has been reached.
16 INVREQ
RESP2 values are:
1
The command is being issued in a non-CICS Web support application.
3
The command is being issued for a non-HTTP request.
4
The command is being issued before a WEB STARTBROWSE FORMFIELD has been issued.
6
A form field has been found that is not in the format NAME:VALUE.
153
The form type is unknown.
154
A boundary string was expected in the forms data, but was not found.
22 LENGERR
RESP2 values are:
1
NAMELENGTH or VALUELENGTH is less than or equal to zero.
4
The form field name has been truncated during a browse operation because the receiving buffer is too small.

The next execution of WEB READNEXT FORMFIELD will return the same field that caused the LENGERR condition. So the LENGERR condition will persist until a large enough buffer is used to contain the name.

5
The form field value has been truncated because the receiving buffer is too small.

The next execution of WEB READNEXT FORMFIELD will return the same field that caused the LENGERR condition. So the LENGERR condition will persist until a large enough buffer is used to contain the value.