field names in javascript

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • dan

    #1

    field names in javascript

    I need to use a different type of name for a field in a form. does
    anyone know how I can access this with this kind of name?

    <input type="text" name ="id[txt_3]" size="6" maxlength="6" value="">

    now how can I access this name in javascript?
    //this doesn't work??

    document.form_n ame.id[txt_3].value
    document.form_n ame.?????????.v alue
  • Lasse Reichstein Nielsen

    #2
    Re: field names in javascript

    ryan000@yahoo.c om (dan) writes:
    [color=blue]
    > I need to use a different type of name for a field in a form. does
    > anyone know how I can access this with this kind of name?
    >
    > <input type="text" name ="id[txt_3]" size="6" maxlength="6" value="">[/color]

    <URL:http://jibbering.com/faq/#FAQ4_39>
    might help you.

    (then read it all :)
    /L
    --
    Lasse Reichstein Nielsen - lrn@hotpop.com
    DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
    'Faith without judgement merely degrades the spirit divine.'

    Comment

    • Michael Winter

      #3
      Re: field names in javascript

      Lasse Reichstein Nielsen wrote on 20 Nov 2003:
      [color=blue]
      > <URL:http://jibbering.com/faq/#FAQ4_39>
      > might help you.[/color]

      It will almost. It doesn't say in the FAQ that square brackets are
      illegal characters in control names. The original poster should see
      my reply in his earlier thread (also started today).

      Mike

      --
      Michael Winter
      M.Winter@blueyo nder.co.uk.invalid (remove ".invalid" to reply)

      Comment

      • Lasse Reichstein Nielsen

        #4
        Re: field names in javascript

        Michael Winter <M.Winter@bluey onder.co.uk.inv alid> writes:
        [color=blue]
        > It doesn't say in the FAQ that square brackets are illegal
        > characters in control names. The original poster should see my reply
        > in his earlier thread (also started today).[/color]

        It does, I just omitted the reference because they are not illegal
        (see my reply to your reply :)

        /L
        --
        Lasse Reichstein Nielsen - lrn@hotpop.com
        DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
        'Faith without judgement merely degrades the spirit divine.'

        Comment

        • Richard Cornford

          #5
          Re: field names in javascript

          "Michael Winter" <M.Winter@bluey onder.co.uk.inv alid> wrote in message
          news:Xns9439EFD ECCA6MWinterBlu eyonder@193.38. 113.46...[color=blue]
          >Lasse Reichstein Nielsen wrote on 20 Nov 2003:
          >[color=green]
          >> <URL:http://jibbering.com/faq/#FAQ4_39>
          >> might help you.[/color]
          >
          >It will almost. It doesn't say in the FAQ that square
          >brackets are illegal characters in control names. The
          >original poster should see my reply in his earlier thread
          >(also started today).[/color]

          It turned out that square brackets are legal characters in the strings
          provided as values to name attributes. The restrictions you mentioned in
          that post do apply to ID attributes but not name (which are just CDATA).

          Prior to the discussion of legal characters in name attribute strings I
          also believed that those additional restrictions applied to name
          attributes as well as IDs. But cross referencing the fragment
          identifiers on the links used in (HTML versions of) the DTDs with the
          fragment identifiers used within the UL/LI element/s used in the "SGML
          basic types" sections of "types.html " in HTML specifications at the W3C
          made it clear that NAME and ID "tokens" are distinct from CDATA.

          Richard.


          Comment

          Working...