Help: Document object's property

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

    #1

    Help: Document object's property

    How do I use a variable value within the document object's property?

    That is, if I have:

    document.profil e_form.firstnam e.value=fname;

    How do I make it more generic, like this:

    desired=fieldna me
    document.profil e_form.desired. value=fname;

    Where firstname is the current field name.

    Craig

    w1zard10@hotSPA Mmail.com (remove SPAM befor emailing)


  • kaeli

    #2
    Re: Help: Document object's property

    In article <9-Odnakaa97ODl6i4 p2dnA@comcast.c om>, w1zard10
    @hotSPAMmail.co m enlightened us with...[color=blue]
    > How do I use a variable value within the document object's property?
    >
    > That is, if I have:
    >
    > document.profil e_form.firstnam e.value=fname;
    >
    > How do I make it more generic, like this:
    >
    > desired=fieldna me[/color]


    If you had the name of a field and wanted dynamic addressing...

    desired = "firstname" ;
    document.forms["formname"].elements[desired].value = somevalue;

    --
    --
    ~kaeli~
    A midget fortune teller who escapes from prison is a small
    medium at large.



    Comment

    • Lasse Reichstein Nielsen

      #3
      Re: Help: Document object's property

      "Craig L" <w1zard10@hotSP AMmail.com> writes:
      [color=blue]
      > How do I use a variable value within the document object's property?[/color]

      <URL: http://jibbering.com/faq/#FAQ4_39 >
      Good luck :)
      /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

      • Craig L

        #4
        Re: Help: Document object's property

        Thanks. It worked out great.

        Craig

        "kaeli" <tiny_one@NOSPA M.comcast.net> wrote in message
        news:MPG.1a2d55 45fabe0ab79899c 9@nntp.lucent.c om...[color=blue]
        > In article <9-Odnakaa97ODl6i4 p2dnA@comcast.c om>, w1zard10
        > @hotSPAMmail.co m enlightened us with...[color=green]
        > > How do I use a variable value within the document object's property?
        > >
        > > That is, if I have:
        > >
        > > document.profil e_form.firstnam e.value=fname;
        > >
        > > How do I make it more generic, like this:
        > >
        > > desired=fieldna me[/color]
        >
        >
        > If you had the name of a field and wanted dynamic addressing...
        >
        > desired = "firstname" ;
        > document.forms["formname"].elements[desired].value = somevalue;
        >
        > --
        > --
        > ~kaeli~
        > A midget fortune teller who escapes from prison is a small
        > medium at large.
        > http://www.ipwebdesign.net/wildAtHeart
        > http://www.ipwebdesign.net/kaelisSpace
        >[/color]


        Comment

        Working...