Dyanmic names for text fields

J

jonschatz

I am creating an Web order system in dreamweaver. I have a page with a
list of possible items for a customer listed in a repeating region with
text boxes to enter quantity. Each field has a unique name in each row
qty1, qty2 etc. I have another field for due date that I would like to
move into a hidden field that I have also placed in each repeating
region. Instead of having code that looks like this

form.duedate1.value = form.x_duedate.value;
form.duedate2.value = form.x_duedate.value;
form.duedate3.value = form.x_duedate.value;

x_duedate is a text field
duedateX is a hidden field in each repeating region

I would like to be able to create a loop since the number of items to
choose from will vary. I already have a loop created with a variable
named x which is the total number of rows (items). Probably fairly
simple I just didn't know how to referrence each duedate hidden field.

Thanks!
 
R

RobG

I am creating an Web order system in dreamweaver. I have a page with a
list of possible items for a customer listed in a repeating region with
text boxes to enter quantity. Each field has a unique name in each row
qty1, qty2 etc. I have another field for due date that I would like to
move into a hidden field that I have also placed in each repeating
region. Instead of having code that looks like this

form.duedate1.value = form.x_duedate.value;
form.duedate2.value = form.x_duedate.value;
form.duedate3.value = form.x_duedate.value;

x_duedate is a text field
duedateX is a hidden field in each repeating region

I would like to be able to create a loop since the number of items to
choose from will vary. I already have a loop created with a variable
named x which is the total number of rows (items). Probably fairly
simple I just didn't know how to referrence each duedate hidden field.

for (var i=1; i<=x; i++){
form.elements['duedate' + i].value = form.elements['x_duedate' +
i].value;
}


Read the FAQ:
<URL: http://www.jibbering.com/faq/#FAQ4_13 >
 
J

jonschatz

RobG said:
I am creating an Web order system in dreamweaver. I have a page with a
list of possible items for a customer listed in a repeating region with
text boxes to enter quantity. Each field has a unique name in each row
qty1, qty2 etc. I have another field for due date that I would like to
move into a hidden field that I have also placed in each repeating
region. Instead of having code that looks like this

form.duedate1.value = form.x_duedate.value;
form.duedate2.value = form.x_duedate.value;
form.duedate3.value = form.x_duedate.value;

x_duedate is a text field
duedateX is a hidden field in each repeating region

I would like to be able to create a loop since the number of items to
choose from will vary. I already have a loop created with a variable
named x which is the total number of rows (items). Probably fairly
simple I just didn't know how to referrence each duedate hidden field.

for (var i=1; i<=x; i++){
form.elements['duedate' + i].value = form.elements['x_duedate' +
i].value;
}


Read the FAQ:
<URL: http://www.jibbering.com/faq/#FAQ4_13 >

Perfect! thanks I really appreciate your help!!!!!
 

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
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top