Help!Help! How to concatenate ...

Discussion in 'Javascript' started by Fed21, May 14, 2004.

  1. Fed21

    Fed21 Guest

    Any experts out there can help to solve the following problem:

    I have the following Javascript expressions:

    temp[0] = document.frmScr1.txtABC
    temp[1] = document.frmScr1.txtDEF
    temp[2] = document.frmScr1.txtHIJ

    And I have created an array to store these values:
    ary["ABC","DEF","HIJ"];

    Now, the problem is that is it possible to generate a FOR loop to
    perform the function as above?
    e.g.
    for (count=0; count < 3; count++) {
    temp[count] = document.frmScr1.txt + ary[count]; // incorrect, guess
    only
    };

    Of course the above code is incorrect, but what should I do or any
    suggestion?

    Many thanks in advance.
    Fed.
    Fed21, May 14, 2004
    #1
    1. Advertising

  2. (Fed21) writes:

    > temp[count] = document.frmScr1.txt + ary[count]; // incorrect, guess
    > only
    > };
    >
    > Of course the above code is incorrect, but what should I do or any
    > suggestion?


    <URL:http://jibbering.com/faq/#FAQ4_39>
    /L
    --
    Lasse Reichstein Nielsen -
    DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
    'Faith without judgement merely degrades the spirit divine.'
    Lasse Reichstein Nielsen, May 14, 2004
    #2
    1. Advertising

  3. Fed.,

    You have to expose the value property in the
    document.frmScr1.txtOBJECTNAME objects

    var temp = new Array();
    var ary["ABC","DEF","HIJ"];

    temp[0] = document.frmScr1.txtABC.value;
    temp[1] = document.frmScr1.txtDEF.value;
    temp[2] = document.frmScr1.txtHIJ.value;

    for (count=0; count < 3; count++) {
    temp[count] = temp[count] + ary[count];
    }


    Fed21 wrote:
    > Any experts out there can help to solve the following problem:
    >
    > I have the following Javascript expressions:
    >
    > temp[0] = document.frmScr1.txtABC
    > temp[1] = document.frmScr1.txtDEF
    > temp[2] = document.frmScr1.txtHIJ
    >
    > And I have created an array to store these values:
    > ary["ABC","DEF","HIJ"];
    >
    > Now, the problem is that is it possible to generate a FOR loop to
    > perform the function as above?
    > e.g.
    > for (count=0; count < 3; count++) {
    > temp[count] = document.frmScr1.txt + ary[count]; // incorrect, guess
    > only
    > };
    >
    > Of course the above code is incorrect, but what should I do or any
    > suggestion?
    >
    > Many thanks in advance.
    > Fed.
    Cycloneous Echevarria, May 14, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mike James
    Replies:
    1
    Views:
    1,816
    Jim Gibson
    Sep 19, 2003
  2. Luis E Valencia

    Concatenate Hyperlink with databinder

    Luis E Valencia, May 27, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    1,675
    Luis E Valencia
    May 27, 2004
  3. =?Utf-8?B?TWlrZSBNb29yZQ==?=

    Concatenate

    =?Utf-8?B?TWlrZSBNb29yZQ==?=, Nov 24, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    4,196
    Mark Rae
    Nov 24, 2004
  4. Luis Esteban Valencia

    Concatenate datalist variables with javascript and html

    Luis Esteban Valencia, Jan 20, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    2,603
    Luis Esteban Valencia
    Jan 20, 2005
  5. Carlos

    Concatenate/De-Concatenate

    Carlos, Oct 12, 2012, in forum: VHDL
    Replies:
    10
    Views:
    848
Loading...

Share This Page