Reading a variable from a form object

I

IDW

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="Javascript">
var num = new String("0");
</script>

[fmp-record]

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

<script language="Javascript">
num++;
</script>

[/fmp-record]
 
L

Lee

IDW said:
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.

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.
 
J

Jürgen Riemer

hi IDW,
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.

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

try

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

lg

mord
 
I

IDW

Jürgen Riemer said:
hi IDW,
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.

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

try

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

lg

mord

Cheers!

Thanks for this.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top