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

1 value 2 fields inserted on form update

Without writing a bible on what I'm trying to do I'll see if someone
can answer a quick question.
I have a form that the user writes a value in a test field. I need to
put a hidden value that will take the same number the user inputs and
insert it in a form.

Basically,

I need ...

<input name="hdndkqty" type="hidden" id="hdndkqty" value = ??? />

the value of the hidden field to = <input name="num" type="text"
id="num2" />

Can someone help?

Oct 16 '06 #1
4 1591
Mangler wrote:
Without writing a bible on what I'm trying to do I'll see if someone
can answer a quick question.
I have a form that the user writes a value in a test field. I need to
put a hidden value that will take the same number the user inputs and
insert it in a form.

Basically,

I need ...

<input name="hdndkqty" type="hidden" id="hdndkqty" value = ??? />

the value of the hidden field to = <input name="num" type="text"
id="num2" />
You will need to use client-side scripting to do this, probably in the
form's onsubmit event. Something like this:

<form ... onsubmit="document.getElementById('hdndkqty').valu e =
document.getElementById('num2').value">

Please followup in a client-side scripting newsgroup like
m.p.scripting.jscript

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Oct 16 '06 #2
I cant show you how to do it now, i will tell you the idea then i will
show you later, cause im late for college.
As Bob said, but i guess if you use functions or subs will work better,
the idea is change the submit button you use into a normal button, that
says when you click it it will run a function or a sub, in that
function/sub you say copy-paste the value from the test field into the
hidden field and then submit the form.

I will try my best to give you the code.
Best Regards
Firas S Assaad

On Oct 16, 9:12 am, "Mangler" <dwald...@directwireless.comwrote:
Without writing a bible on what I'm trying to do I'll see if someone
can answer a quick question.
I have a form that the user writes a value in a test field. I need to
put a hidden value that will take the same number the user inputs and
insert it in a form.

Basically,

I need ...

<input name="hdndkqty" type="hidden" id="hdndkqty" value = ??? />

the value of the hidden field to = <input name="num" type="text"
id="num2" />

Can someone help?
Oct 17 '06 #3
I appreciate the help! Very new to all of this...
Firas wrote:
I cant show you how to do it now, i will tell you the idea then i will
show you later, cause im late for college.
As Bob said, but i guess if you use functions or subs will work better,
the idea is change the submit button you use into a normal button, that
says when you click it it will run a function or a sub, in that
function/sub you say copy-paste the value from the test field into the
hidden field and then submit the form.

I will try my best to give you the code.
Best Regards
Firas S Assaad

On Oct 16, 9:12 am, "Mangler" <dwald...@directwireless.comwrote:
Without writing a bible on what I'm trying to do I'll see if someone
can answer a quick question.
I have a form that the user writes a value in a test field. I need to
put a hidden value that will take the same number the user inputs and
insert it in a form.

Basically,

I need ...

<input name="hdndkqty" type="hidden" id="hdndkqty" value = ??? />

the value of the hidden field to = <input name="num" type="text"
id="num2" />

Can someone help?
Oct 17 '06 #4
Have a look at the code.
and then look at the address bar to see the the value in the second
field is the same as the first one.

and if you want it hidden, it will not affect anything, just change the
type to hidden

<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE></TITLE>
</HEAD>
<BODY>

<script language=javascript>
function Dupl()
{
document.form1.test2.value=document.form1.test1.va lue;
document.form1.submit();
}
</script>
<form name=form1 method=get>
<input type=text name=test1 >
<input type=text name=test2 >
<input type=button name=test3 value=asd onclick="javascript:Dupl();">

</form>
</BODY>
</HTML>

Hope this helps.
Best Regards
Firas S Assaad

On Oct 17, 9:33 am, "Mangler" <dwald...@directwireless.comwrote:
I appreciate the help! Very new to all of this...

Firas wrote:
I cant show you how to do it now, i will tell you the idea then i will
show you later, cause im late for college.
As Bob said, but i guess if you use functions or subs will work better,
the idea is change the submit button you use into a normal button, that
says when you click it it will run a function or a sub, in that
function/sub you say copy-paste the value from the test field into the
hidden field and then submit the form.
I will try my best to give you the code.
Best Regards
Firas S Assaad
On Oct 16, 9:12 am, "Mangler" <dwald...@directwireless.comwrote:
Without writing a bible on what I'm trying to do I'll see if someone
can answer a quick question.
I have a form that the user writes a value in a test field. I need to
put a hidden value that will take the same number the user inputs and
insert it in a form.
Basically,
I need ...
<input name="hdndkqty" type="hidden" id="hdndkqty" value = ??? />
the value of the hidden field to = <input name="num" type="text"
id="num2" />
Can someone help?- Hide quoted text -- Show quoted text -
Oct 18 '06 #5

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

Similar topics

1
by: PT | last post by:
I got a problem. And thats..... First of all, I got these three tables. ------------------- ------------------ ---------------------- tblPerson tblPersonSoftware ...
4
by: Jack | last post by:
Hi, I have a checkbox the value which goes to a database via a asp page that builds the sql string. In the front end asp page, the checkbox code is written as follows: <i><input...
2
by: lgo | last post by:
I have read several variations of this topic posted on this news group. However I was not able to find the answer for my problem. I am trying to build code (see below) to update a large single...
0
by: sienayr | last post by:
Greetings, I have searched hi and lo through the groups and haven't found my problem specifically. I have listed below what I have tried based on what I have found in the groups. Please let me...
1
by: BlackFireNova | last post by:
I'm using Access 2003, on Windows XP Pro. I have a subform which is launched from a command button on my main form. When this form opens, I have 2 fields which I have inserted VBA Code into to...
9
by: Ecohouse | last post by:
I have a main form with two subforms. The first subform has the child link to the main form identity key. subform1 - Master Field: SK Child Field: TrainingMasterSK The second subform has a...
2
by: Kev | last post by:
Hello world, I am trying to capture the latest entry into a text box by the user and then insert it in a separate text box. I must not be searching the right key words because I can only find...
3
by: dhaneshrs | last post by:
I have a gridview i managed to update using the edit option in the smartmenu. The problem comes when i delete a value or make a value read only. Say i have a table Employee with the following...
1
by: Aleck | last post by:
Hie. I have a trigger that monitors changes to my table fields but I get an error saying subquery returned more than one value.Below is the code for my trigger, hope you will figure out whats...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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
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
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...

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.