By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,747 Members | 1,778 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,747 IT Pros & Developers. It's quick & easy.

Reading a variable from a form object

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a
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.