Difference between revisions of "Ns formvalueput"

From AOLserver Wiki
Jump to navigation Jump to search
m (Fixed typo)
(Oops. Testing examples found problems. THere will be more edits.)
Line 19: Line 19:
 
::;submit: ignored
 
::;submit: ignored
 
::;reset: ignored
 
::;reset: ignored
::;checkbox: will be checked if the NAME attribute matches the ''datavalue'' (case-insensitive)
+
::;checkbox: will be checked if the NAME attribute matches the ''dataname'' (case insensitive) and the VALUE attribute matches the ''datavalue'' (case-sensitive)
::;radio: will be selected if the NAME attribute matches the ''datavalue'' (case-insensitive)
+
::;radio: will be checked if the NAME attribute matches the ''dataname'' (case insensitive) and the VALUE attribute matches the ''datavalue'' (case-sensitive)
::;''any other'':If the NAME attribute matches the ''dataname'', the VALUE attribute will be set to the ''datavalue''
 
 
:* TEXTAREA
 
:* TEXTAREA
 
::If the NAME attribute matches the ''dataname'', all the enclosed text up to the next <nowiki></textarea></nowiki> tag will be replaced by the ''datavalue''.
 
::If the NAME attribute matches the ''dataname'', all the enclosed text up to the next <nowiki></textarea></nowiki> tag will be replaced by the ''datavalue''.

Revision as of 19:09, 8 February 2008

Man page: not in source tree


NAME

ns_formvalueput - Sets the value of input elements in HTML documents

SYNOPSIS

ns_formvalueput htmlpiece dataname datavalue

DESCRIPTION

This command sets the value of an HTML input element with NAME=dataname (of any type) to the given datavalue. In the following descriptions, all attribute names are handled in case-insensitive fashion (as required by HTML)
The elements (tags) & types supported are:
  • INPUT
image
ignored
submit
ignored
reset
ignored
checkbox
will be checked if the NAME attribute matches the dataname (case insensitive) and the VALUE attribute matches the datavalue (case-sensitive)
radio
will be checked if the NAME attribute matches the dataname (case insensitive) and the VALUE attribute matches the datavalue (case-sensitive)
  • TEXTAREA
If the NAME attribute matches the dataname, all the enclosed text up to the next </textarea> tag will be replaced by the datavalue.
  • SELECT
If the NAME attribute of the SELECT tag matches the dataname, this will find the first enclosed OPTION tag with a VALUE attribute that matches datavalue, and set its SELECTED attribute. All other enclosed OPTION tags will have their SELECTED attribute removed.

EXAMPLES


NOTES

  • This procedure requires that Ns_tagelement not return the trailing > for elements. That feature of Ns_tagelement sometimes confuses people.

Category Documentation - Category Core Tcl API