R
Royse
Hi Group
I'm trying to get the value from a select and place it into some text
fields.
all these fields have the same name.
when a user enters the page all fields are empty
Then, when they click on one of the options I want it to fill the first
field, then when they click on another option it should fill the second
and so on.
this is the script
//////////////////////////////////////////////////
function insert() {
counter = document.form1.LastCols.selectedIndex;
for( var i=0; i<document.forms.length;i++){
for( var j=0;j<document.forms.elements.length;j++) {
if(document.forms.elements[j].type == "text" &&
document.forms.elements[j].value == "" ) {
document.forms.elements[j].value =
document.form1.LastCols.options[counter].value;
}
}
}
}
///////////////////////////////////////////////
What this does is fill all text fields with whatever is clicked first,
What I need is to fill them incrementally
Any suggestion are well appreciated
Royse
I'm trying to get the value from a select and place it into some text
fields.
all these fields have the same name.
when a user enters the page all fields are empty
Then, when they click on one of the options I want it to fill the first
field, then when they click on another option it should fill the second
and so on.
this is the script
//////////////////////////////////////////////////
function insert() {
counter = document.form1.LastCols.selectedIndex;
for( var i=0; i<document.forms.length;i++){
for( var j=0;j<document.forms.elements.length;j++) {
if(document.forms.elements[j].type == "text" &&
document.forms.elements[j].value == "" ) {
document.forms.elements[j].value =
document.form1.LastCols.options[counter].value;
}
}
}
}
///////////////////////////////////////////////
What this does is fill all text fields with whatever is clicked first,
What I need is to fill them incrementally
Any suggestion are well appreciated
Royse