WebFormValuePairRemove Function

Action

Removes a number of pairs of values from a Web form declared in the dclform section. This function can be used to dynamically modify the content of a Web form.

Include file

WebAPI.bdh

Syntax

WebFormValuePairRemove( in fForm      : form,
                        in sLeftValue : string,
                        in nPosition  : number optional ): boolean;

Return value

  • true if successful

  • false otherwise

Parameter Description
fForm Web form whose content will be reduced by all matching pairs of values
sLeftValue String representing the left-side value of all pairs of values removed from the Web form
nPosition

Position of the pair of values which is removed (optional).

If this parameter is passed to the function, the sLeftValue parameter is ignored. Otherwise, if this parameter is omitted, Silk Performer searches the Web form for all occurrences of sLeftValue and removes all matching entries

Example

dcltrans
  transaction TMain
  var
    sFirstName, sLastName, sPhone: string;
  begin
    WebFormValuePairInsert(fForm, "street", "Beach Road");
    WebFormValuePairInsert(fForm, "phone", "1212-555-8532");
    WebFormValueGet(fForm, sFirstName, STRING_COMPLETE, "first name");
    WebFormValueGet(fForm, sLastName, STRING_COMPLETE, "last name");
    WebFormValueGet(fForm, sPhone, STRING_COMPLETE, "phone");
    write("first name = "); write(sFirstName); writeln;
    write("last name = "); write(sLastName); writeln;
    write("phone = "); write(sPhone); writeln;
    WebFormValueSet(fForm, "phone", "1411-555-0969");
    WebFormValueGet(fForm, sPhone, STRING_COMPLETE, "phone");
    write("phone = "); write(sPhone); writeln;
    WebFormValuePairRemove(fForm, "street");
    WebFormClear(fForm);
  end TMain;

dclform
  fForm:
    "first name" := "Peter",
    "last name"  := "Heart";

Sample scripts

WebForms04.bdf