473,396 Members | 1,676 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.

Passing Multiple value textbox without loading page

Fary4u
273 100+
using <input values> text box to another text box in sort of array function to passing multiple value without loading page on one click of button

Expand|Select|Wrap|Line Numbers
  1. <script type='text/javascript'>
  2. function test(el){
  3.     while(el.tagName != 'FORM')
  4.         el = el.parentNode;
  5.     var input = el.getElementsByTagName('INPUT');
  6.     var elementString = '';
  7.     for(var i=0; i<input.length; i++)
  8.         elementString += input[i].name + '=' + input[i].value + '&';
  9.     elementString = elementString.substring(0, elementString.length - 1);
  10.     alert(elementString);
  11. }
  12. </script>
  13. <form name='example'>
  14. <table>
  15.  <tr><th>Item 1</th><td><input name='item1' value="1"></td></tr>
  16.  <tr><th>Item 2</th><td><input name='item2' value="2"></td></tr>
  17.  <tr><th>Item 3</th><td><input name='item3' value="3"></td></tr>
  18.  <tr><th>Item 3</th><td><input name='item4' value="4"></td></tr>
  19.  <tr><th>Item 3</th><td><input name='item5' value="5"></td></tr>
  20. <tr><td colspan=2><input name='button' value='submit me' type='button' onclick='test(this)'></form>
  21. <form name='example2'>display values<input name='ite1'><input name='ite2'><input name='ite3'><input name='ite4'><input name='ite5'></form>
  22. </td></tr></table>
  23.  
May 31 '12 #1

✓ answered by Dormilich

Expand|Select|Wrap|Line Numbers
  1. input_a[i].value = input_b[j].value
PS. the better you explain, the better can I answer

5 4193
Dormilich
8,658 Expert Mod 8TB
passing multiple value in just one click of button.
er, you always pass all input elements* when submitting a form.


* - exceptions are unselected radio buttons/checkboxes
May 31 '12 #2
Fary4u
273 100+
without loading a page passing values 1 text box to another text box.
May 31 '12 #3
Dormilich
8,658 Expert Mod 8TB
Expand|Select|Wrap|Line Numbers
  1. input_a[i].value = input_b[j].value
PS. the better you explain, the better can I answer
May 31 '12 #4
Fary4u
273 100+
thxs dormilich can u be more specific ?
May 31 '12 #5
Dormilich
8,658 Expert Mod 8TB
not with the given information.
May 31 '12 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: sam pal | last post by:
I have the following programs and please clear my doubts. Passing the value by reference is same as pointer by reference. Is this true? What is the difference between display and display2? How...
25
by: Victor Bazarov | last post by:
In the project I'm maintaining I've seen two distinct techniques used for returning an object from a function. One is AType function(AType const& arg) { AType retval(arg); // or default...
3
by: David Bacon | last post by:
Hi All, I am new to C#, and am having trouble passing the value of a variable from one windows form to another. Can anyone point me in the right direction. Any help here would be greatly...
7
by: Cemal Karademir | last post by:
Hello, Please forgive my simple question, but i don't know the correct synatx. From the masterpage i want to put a text in an textbox and then select an item in the datagrid. I do know how to...
2
by: o1j2m3 | last post by:
I created 2 forms, A and B using VB.NET 2003 in A, the codes are : ========================== public AsName as string public AsPrice as double public sub setValue(ByVal sname as string,...
2
by: Mike P | last post by:
When you are passing a value to another page, and will need access to it throughout the page and on any postbacks, what is the best way to store it? By making it a variable accessible to the whole...
2
by: jonefer | last post by:
I'm using a Public variable that I set on one page so that it will be available for another page but, I know this isn't the way it should be done. Being an Access Developer, how would I do the...
4
by: kimberly.walker | last post by:
Im having a bit of a problem here, what I want to do is a user types in data in a text box then I need to pass that data to the client side. The problem Im having is I can't seem to get the value...
12
by: dave_dp | last post by:
Hi, I have just started learning C++ language.. I've read much even tried to understand the way standard says but still can't get the grasp of that concept. When parameters are passed/returned...
1
by: imtmub | last post by:
Hi All, I have mainpage (POselect.aspx). language VB In that page i have a textbox (txtPOId) and command button(Button1) When i press then button its should send the textbox value to Crystal...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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.