473,503 Members | 1,697 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Transfer / copy data between textboxes

I have 2 textboxes (textbox1 and textbox2) and one hidden field
(hidden). I want the value of the hidden field to be both values of
textbox1 and textbox2 separated with "-".

Example:
textbox1 = "15"
textbox2 = "25"
Hidden = "15-25"

Hope someone can help me!!!

Regards
Øyvind Isaksen
Jul 23 '05 #1
2 1485
This should do it

<FORM NAME="formname">

<INPUT TYPE="text" NAME="textbox1" onChange="copy();">
<INPUT TYPE="text" NAME="textbox2" onChange="copy();">
<INPUT TYPE="hidden" NAME="hidden">
</FORM>

<SCRIPT LANGUAGE="JavaScript">
function copy() {
from = document.forms['formname'];
form.hidden.value = form.textbox1.value+'-'+form.textbox2.value;
}
</SCRIPT>

Good luck,
Vincent

Øyvind Isaksen wrote:
I have 2 textboxes (textbox1 and textbox2) and one hidden field
(hidden). I want the value of the hidden field to be both values of
textbox1 and textbox2 separated with "-".

Example:
textbox1 = "15"
textbox2 = "25"
Hidden = "15-25"

Hope someone can help me!!!

Regards
Øyvind Isaksen


Jul 23 '05 #2
oy****@webressurs.no (Øyvind Isaksen) wrote in message news:<3e**************************@posting.google. com>...
I have 2 textboxes (textbox1 and textbox2) and one hidden field
(hidden). I want the value of the hidden field to be both values of
textbox1 and textbox2 separated with "-".

Example:
textbox1 = "15"
textbox2 = "25"
Hidden = "15-25"

Hope someone can help me!!!

Regards
Øyvind Isaksen


Something like:

<script type="text/javascript">

document.forms[formName].hiddenBox.value =
document.forms[formName].text1.value + '-' +
document.forms[formName].text2.value;

</script>
Shawn
Jul 23 '05 #3

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

Similar topics

1
2527
by: midwesthills | last post by:
How can I transfer the schema of a database from one SQL Server app to another? I've used MySQL in the past and all I had to do is create a ..sql file with the DDL statements for the database,...
0
1257
by: TF | last post by:
Hi, Scenario: I have few TextBoxes on a WinForm, bound to a DataSet (using DataBindings collection). Initially only schema is filled in DataSet (using FillSchema() method), then a new row is...
1
2170
by: Zhongqi Pan | last post by:
I am facing a problem- I am using f1(this) to pass a class object pointer to a function ( say f1) f1 is defined as follows
11
6592
by: Abhishek | last post by:
I have a problem transfering files using sockets from pocket pc(.net compact c#) to desktop(not using .net just mfc and sockets 2 API). The socket communication is not a issue and I am able to...
7
3622
by: monkeydragon | last post by:
how to would you transfer a DWORD variable from inside of a function to the caller ex. InvokeProcessData(LPDWORD prtDW) { ... // we have created, initialized and processed // dword variable...
3
2388
by: tkirke | last post by:
How does one transfer a buffer object from python -c and back again (assuming the data gets modified)? I can't seem to get this or anything else to work, but am clueless as to what I'm doing wrong...
38
2921
by: Tom | last post by:
I need my data generating C program on computer #1 to export small amounts of data (one - 40 byte data structure) periodically (once per minute) to a C program on computer #2. I am considering...
17
5076
by: Steve | last post by:
I'm trying to code cut, copy, and paste in vb 2005 so that when the user clicks on a toolbar button, the cut/copy/paste will work with whatever textbox the cursor is current located in (I have...
4
4615
by: Luvin lunch | last post by:
Hi, I've developed a worklist system in Access and I plan to deploy four copies of it to the four users that need it. I said I'll be deploying copies because there is no shared network in the...
0
7074
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
7273
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,...
1
6982
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
7451
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
5572
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
4667
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3161
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
731
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
374
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.