WebPageSetActionUrl Function

Action

Modifies the action URL of a subsequent WebPageSubmit or WebPageSubmitBin function using a URL parsed by a call to the WebPageParseUrl function.

If only the action URL of an HTML form is changed with client side scripting, all fields of the parsed form can be used and the action URL can be changed to any parsed URL.

Include file

WebAPI.bdh

Syntax

WebPageSetActionUrl( in sUrl     : string,
                     in nUrlNo   : number optional,
                     in sFrame   : string optional,
                     in hContext : number optional): boolean;

Return value

  • true if the operation completed successfully

  • false otherwise

Parameter Description
sUrl Specifies the URL (parsed by a call to WebPageParseUrl) of which the URL should be used as action URL in the subsequent form submission. This URL is searched in the currently active Web page, or if the hContext parameter is not omitted it is searched in the specified context.
nUrlNo Number of the URL in the specified frame (optional). The first appearance is taken if this parameter is omitted.
sFrame Specifies the frame where to search the URL.
hContext Context, stored by a prior call of the WebPageStoreContext function, where to search the URL (optional). If this parameter is omitted the URL is searched in the actual page and all stored contexts.

Example

dcltrans
  transaction TMain
  begin
    WebPageParseUrl("Continue", "load=\"", "\"");
    WebPageUrl("http://lab3/shopit/", "ShopIt - Greetings");
    WebPageLink("Join the experience!", "ShopIt - New Visitor");
    WebPageSetActionUrl("Continue");
    WebPageSubmit("buy", FORM_BUY, "ShopIt - Main menu");
  end TMain;

dclform
  FORM_BUY;