Re: FAQ Topic - How do I get the value of a form control? (2009-06-19)



Thomas 'PointedEars' Lahn wrote:
[...]
How do I get the value of a form control?

Correct answers include:

"Form controls can be referred to in different ways, depending on
the context of the reference and the location of the target control.

The following ways are fully standards-compliant (the proprietary `document'
property serves as a starting point for the implementation). Nevertheless,
you should perform run-time feature-tests prior to calling these methods as
not all browsers implement all standards.

1. Referring to a control that is not located within a form, is located
in the same form or in another form:

By ID: document.getElementById("...") [DOM3Core]
By name: document.getElementsByName("...")[...] [DOM2HTML]
By element type: document.getElementsByTagName("...")[...] [DOM3Core]
By XPath: document.evaluate("...")... [DOMXPath]

By CSS selector: document.querySelectorAll("...")[...] [Selector]


[...]

--
kangax
.



Relevant Pages

  • Re: Ridding myself of "You are about to add n records to a New Table"
    ... Not just a handlful. ... I tend to use "With" any time I'm going to be referring to an object ... reference needs to be interpreted ... way if I ever want to change the name of the control, ...
    (microsoft.public.access.modulesdaovba)
  • Re: Deleting Section markers
    ... The folks you are referring to as "professionals" are the ones that I referred to as "all those poor folks who had FINALLY figured out how to control all those strange behaviors" ...
    (microsoft.public.mac.office.word)
  • RE: Custom control within repeater with custom object binding
    ... Calendar is elsewhere on the page, not in a repeater. ... did not clarify what are you referring to. ... 2- when you say "The control shows a null object however the static fields ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Calculating age in a form
    ... When you are referring to a field in a table from within a form, ... The simpler version of this happens when you refer to a control on the SAME ... "Jeff Boyce" wrote: ... My first attempt at this involved a query with the same expression, ...
    (microsoft.public.access.forms)
  • RE: Custom control within repeater with custom object binding
    ... The problem you got could have happened if you had added your custom control ... Calendar is elsewhere on the page, not in a repeater. ... did not clarify what are you referring to. ... 2- when you say "The control shows a null object however the static fields ...
    (microsoft.public.dotnet.framework.aspnet)

Loading