Sets the left-side and/or the right-side value of a Web form entry. This function can be used to dynamically modify the content of a Web form.
WebAPI.bdh
WebFormValueSet( in fForm : form, in sLeftValue : string allownull, in sRightValue : string allownull, in nPosition : number optional in nAttribute : number optional ): boolean;
true if successful
false otherwise
Parameter | Description |
---|---|
fForm | Web form whose content will be modified |
sLeftValue | String representing the left-side value to set or to search for, depending on the nPosition parameter |
sRightValue | String representing the right-side value to set or to search for, depending on the nPosition parameter |
nPosition |
Position of the Web form entry whose values will be set (optional). If this parameter is passed to the function, the function behaves as follows:
Otherwise, if this parameter is omitted, Silk Performer searches the Web form for a matching left-side value and sets the corresponding right-side value. |
nAttribute | Attribute of the pair of values (optional). If this value is omitted no special attribute is assigned. See the form attributes section in the Web form declarations section for all possible values. |
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", 0, USE_HTML_VAL); 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";
WebForms04.bdf