473,408 Members | 2,087 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

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 3734
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: BigDadyWeaver | last post by:
I am using the following code in asp to define a unique and unpredictable record ID in Access. <% 'GENERATE UNIQUE ID Function genguid() Dim Guid guid =...
1
by: Randell D. | last post by:
HELP! I am determined to stick with this... I'm getting there... for those who haven't read my earlier posts, I'm createing what should be a simple function that I can call to check that...
2
by: C Gillespie | last post by:
Dear All, I have 2 arrays var A1 = new Array(); A1 ="Y2"; var B1 = new Array(); B1 ="Y1"; B1 ="sink";
4
by: Barry Edmund Wright | last post by:
Hi All, I am using the code below to assign a form name to a form variable (vFrm). Is there a way to assign the Openargs string directly to vFrm, i.e. vFrm = Openargs ? Private Sub...
7
by: Aaron | last post by:
Complete code follows. I am new to .NET programming (and programming in general) and I am having a difficult time understanding how to fill a variable in one sub, and then access it from...
2
by: Mad Scientist Jr | last post by:
i'm trying to read a file byte by byte (and later alter the data and write it to a 2nd file byte by byte) and running into a problem where it seems to keep reading the same byte over and over again...
4
by: Mike TI | last post by:
April 22, 2006 Hi all I want to execute a command stored in a variable, eg I may store: Form1.Show() or Form2.Show()
3
by: Zeke Zinzul | last post by:
Hi Guys & Geeks, What's the most elegant way of dealing with binary data and structures? Say I have this (which I actually do, a woo-hoo): struct Struct_IconHeader { byte width; byte...
111
by: Tonio Cartonio | last post by:
I have to read characters from stdin and save them in a string. The problem is that I don't know how much characters will be read. Francesco -- ------------------------------------- ...
2
by: Derik | last post by:
I've got a XML file I read using a file_get_contents and turn into a simpleXML node every time index.php loads. I suspect this is causing a noticeable lag in my page-execution time. (Or the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.