473,396 Members | 1,886 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,396 software developers and data experts.

inserting value into next text field

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[i].elements.length;j++) {

if(document.forms[i].elements[j].type == "text" &&
document.forms[i].elements[j].value == "" ) {

document.forms[i].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

Jul 23 '05 #1
2 1404
Lee
Royse said:

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[i].elements.length;j++) {

if(document.forms[i].elements[j].type == "text" &&
document.forms[i].elements[j].value == "" ) {

document.forms[i].elements[j].value =
document.form1.LastCols.options[counter].value;
break; // otherwise, you continue to loop and add this value to other fields
}
}
}
}
///////////////////////////////////////////////
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


Jul 23 '05 #2
Thanks Lee

Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: pmud | last post by:
I have an ASP.NET web application using C# code. I am trying to insert values from a web form into an SQL database. I am using SQL COMMAND object for this. I need to know HOW TO INSERT THE RADIO...
0
by: wjer | last post by:
I am trying to do two things for a test app: 1) Populate a CheckboxList webcontrol by loading a list of subject names (for the DataTextField) and subject codes (for the DataValueField). 2)...
3
by: Ricardo Luceac | last post by:
HI... I have a web page that pass aa context to another.. The second page receives the context and need to put the value of the context into a sql table.. The value is passing ok, 'cause i...
2
by: clinttoris | last post by:
Hello, If someone could help me it would be appreciated as I am not having much luck. I'm struggling with my asp code and have some questions relating to asp and oracle database. First...
9
by: MrHelpMe | last post by:
Hello again experts, I have successfully pulled data from an LDAP server and now what I want to do is drop the data into a database table. The following is my code that will insert the data but...
7
by: turtle | last post by:
I want to find out the max value of a field on a report if the field is not hidden. I have formatting on the report and if the field doesn't meet a certain criteria then it is hidden. I want to...
0
by: toyin | last post by:
hello, pls help look through this code its not inserting the record in dataset into the another database. i want to insert the row in the dataset into another table in another database. pls help....
4
by: sialater | last post by:
Hello, I realise there are a lot of topics related to this problem but many of what I have found has run cold or unresolved. What I have is an addressbook clone where there are groups which have...
14
Parul Bagadia
by: Parul Bagadia | last post by:
Here is the code i hav written for inserting a no., after given no. in a link list; i guess the logic is ofcourse right. there is no error in it, but at the time of display its not displaying the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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,...

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.