Reading a variable from a form object

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

    Reading a variable from a form object

    Hi,

    I am trying to read the value from a series of text fields in a form. The
    problem is I am using Javascript to do a document.write the input tag
    containing the text field. The reason why I think I have to do this is I
    need to have the name changed each time as this field could repeat it's self
    up to 7 times and it would need an unique name.

    the code is below and the alert doesn't work. The fmp tags are CDML tags
    and used by the Filemaker database.

    Can anybody shed any light on where I am going wrong.

    TIA



    this is the function

    amount0 = document.form1. units0.value;
    alert(amount0)

    This is the code in my page

    <script language="Javas cript">
    var num = new String("0");
    </script>

    [fmp-record]

    <script>documen t.write("<input name=units"+ num +"type='text '
    value='[fmp-field: unitscalc]'>")</script>

    <script language="Javas cript">
    num++;
    </script>

    [/fmp-record]


  • Jürgen Riemer

    #2
    Re: Reading a variable from a form object

    hi IDW,

    IDW wrote:[color=blue]
    > Hi,
    >
    > I am trying to read the value from a series of text fields in a form. The
    > problem is I am using Javascript to do a document.write the input tag
    > containing the text field. The reason why I think I have to do this is I
    > need to have the name changed each time as this field could repeat it's self
    > up to 7 times and it would need an unique name.[/color]

    [color=blue]
    > <script>documen t.write("<input name=units"+ num +"type='text '
    > value='[fmp-field: unitscalc]'>")</script>[/color]

    try

    document.write( "<input name='units"+nu m+"' type='text' value='asdf'>") ;

    lg

    mord

    Comment

    • Lee

      #3
      Re: Reading a variable from a form object

      IDW said:[color=blue]
      >
      >Hi,
      >
      >I am trying to read the value from a series of text fields in a form. The
      >problem is I am using Javascript to do a document.write the input tag
      >containing the text field. The reason why I think I have to do this is I
      >need to have the name changed each time as this field could repeat it's self
      >up to 7 times and it would need an unique name.
      >
      >the code is below and the alert doesn't work. The fmp tags are CDML tags
      >and used by the Filemaker database.
      >
      >Can anybody shed any light on where I am going wrong.[/color]

      You haven't shown enough of your code. Among other things,
      the sequence of events is important. Trim your code down to
      a small sample that shows the problem and post it, or post a
      link to the actual page.

      Comment

      • IDW

        #4
        Re: Reading a variable from a form object

        "Jürgen Riemer" <juergen.riemer @chello.at> wrote in message
        news:3FA13A3B.2 060405@chello.a t...[color=blue]
        > hi IDW,
        >
        > IDW wrote:[color=green]
        > > Hi,
        > >
        > > I am trying to read the value from a series of text fields in a form.[/color][/color]
        The[color=blue][color=green]
        > > problem is I am using Javascript to do a document.write the input tag
        > > containing the text field. The reason why I think I have to do this is[/color][/color]
        I[color=blue][color=green]
        > > need to have the name changed each time as this field could repeat it's[/color][/color]
        self[color=blue][color=green]
        > > up to 7 times and it would need an unique name.[/color]
        >
        >[color=green]
        > > <script>documen t.write("<input name=units"+ num +"type='text '
        > > value='[fmp-field: unitscalc]'>")</script>[/color]
        >
        > try
        >
        > document.write( "<input name='units"+nu m+"' type='text' value='asdf'>") ;
        >
        > lg
        >
        > mord
        >[/color]

        Cheers!

        Thanks for this.


        Comment

        Working...