util::html::get_form (public)

 util::html::get_form -forms forms [ -id id ]

Defined in packages/acs-tcl/tcl/html-procs.tcl

Extract form with the specified id from a structure as that coming from util::html::get_forms proc.

Switches:
-forms (required)
Form structure
-id (optional)
HTML id of the form to be read. If structure contains only one form, this parameter can be omitted, otherwise the proc will throw an error.
Returns:
form structure

Partial Call Graph (max 5 caller/called nodes):
%3 util::http::cookie_auth util::http::cookie_auth (public) util::html::get_form util::html::get_form util::http::cookie_auth->util::html::get_form

Testcases:
No testcase defined.
Source code:
    if {[llength $forms] == 1} {
        return [lindex $forms 0]
    }

    if {$id ne ""} {
        # We have more than one form, check for supplied id
        foreach form $forms {
            if {[dict get $form attributes id] eq $id} {
                return $form
            }
        }
    }

    error "Form was not found in supplied HTML"
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: