469,323 Members | 1,575 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,323 developers. It's quick & easy.

Reading a variable from a form object

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]
Jul 20 '05 #1
3 3659
hi IDW,

IDW wrote:
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

Jul 20 '05 #2
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.

Jul 20 '05 #3
IDW
"Jürgen Riemer" <ju************@chello.at> wrote in message
news:3F**************@chello.at...
hi IDW,

IDW wrote:
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.
Jul 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by C Gillespie | last post: by
4 posts views Thread by Barry Edmund Wright | last post: by
2 posts views Thread by Mad Scientist Jr | last post: by
111 posts views Thread by Tonio Cartonio | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by Gurmeet2796 | last post: by
reply views Thread by harlem98 | last post: by
reply views Thread by listenups61195 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.