473,804 Members | 3,311 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

writing from hidden field to text field

Hi Group
I'm trying to write from dynamically created hidden fields to a txt
field in the onchange event handler within a select.

basically the number for the for loop is generated by a field from a
db
which creates hidden fields populated by prices
once the onchange handler fires it sets the text for the text field
price and the hidden field Tsize, but I can't get it to set the txt of
oldprice from the hidden field prevprice.

here's the code
<SCRIPT LANGUAGE=JavaSc ript>
<!--
function ch_price (theForm) {
for (i=0; i < <%=(rsSaleC.Fie lds.Item('prodC ').Value)%>; i++){

document.form1. price.value =
document.form1. size.options[document.form1. size.selectedIn dex].value;

document.form1. Tsize.value =
document.form1. size.options[document.form1. size.selectedIn dex].text;

document.form1. oldprice.value = document.form1. prevprice[i].value;
}
}
//-->

</SCRIPT>
and in the body
<select name="size" id="size" onChange="ch_pr ice(form1)">
<option selected
value="<%=(rsDi splay.Fields.It em("Price").Val ue)%> ">Select
Size/Colour</option>

<%
while (!rsSale.EOF) {
%>
<option
value="<%=(rsSa le.Fields.Item( "price").Value) %>"
<%=(rsSize.Fie lds.Item("Size" ).Value)%></option>

<%
rsSale.MoveNext ();
}
if (rsSale.CursorT ype > 0) {
if (!rsSale.BOF) rsSale.MoveFirs t();
} else {
rsSale.Requery( );
}
%>

does any one have any ideas?
Jul 23 '05 #1
1 2223
Roy Adams wrote:
Hi Group
I'm trying to write from dynamically created hidden fields to a txt
field in the onchange event handler within a select.

basically the number for the for loop is generated by a field from a
db
which creates hidden fields populated by prices
once the onchange handler fires it sets the text for the text field
price and the hidden field Tsize, but I can't get it to set the txt of oldprice from the hidden field prevprice.

here's the code
<SCRIPT LANGUAGE=JavaSc ript>
<!--
function ch_price (theForm) {
for (i=0; i < <%=(rsSaleC.Fie lds.Item('prodC ').Value)%>; i++){

document.form1. price.value =
document.form1. size.options[document.form1. size.selectedIn dex].value;

document.form1. Tsize.value =
document.form1. size.options[document.form1. size.selectedIn dex].text;

document.form1. oldprice.value = document.form1. prevprice[i].value;
}
}
//-->

</SCRIPT>
and in the body
<select name="size" id="size" onChange="ch_pr ice(form1)">
<option selected
value="<%=(rsDi splay.Fields.It em("Price").Val ue)%> ">Select
Size/Colour</option>

<%
while (!rsSale.EOF) {
%>
<option
value="<%=(rsSa le.Fields.Item( "price").Value) %>"
<%=(rsSize.Fie lds.Item("Size" ).Value)%></option>

<%
rsSale.MoveNext ();
}
if (rsSale.CursorT ype > 0) {
if (!rsSale.BOF) rsSale.MoveFirs t();
} else {
rsSale.Requery( );
}
%>

does any one have any ideas?


It's always easier to diagnose client-side problems when you can see
what the client sees. Do you have a sample of the relevant portions of
a served (no asp) page that you could post?

Jul 23 '05 #2

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

Similar topics

10
3708
by: Randell D. | last post by:
Folks, Perhaps someone can figure this out - this is 'the process of my script' I have a form whereby I can add multiple contacts to a single address. There is only one firstname/lastname/telephone box - when the user clicks the add button, I read the values from the form fields and record them into a hidden text input field. This part works because during debugging, I have converted the <input type=hidden> into a <input type=text>...
1
9596
by: mark.reichman | last post by:
First off.. Thanks to Grant Wagner for help in a previous thread related to this one. I am at a total loss... I have multiple fields in a form with the same name. Lets call the fields with the same name "junk_array". My first field of junk_array is a input type=hidden. All the others fields in junk_array that follow are type=text. I can reference this first hidden field in IE with document.form.field.value. In, fact my form works...
3
2221
by: Roy Adams | last post by:
Hi I'm reposting this question because for some reason can't post follow up question to this thread. What I'm trying to do is put the value and text from a a select in to a text field and to a hidden field respectfully and the value from dynamically created hidden fiields in to a text fieldin to a text field all at the same time Here's the code as viewed through the browser <body bgcolor="#FFFFFF" text="#000000" > <SCRIPT...
4
3908
by: GavMc | last post by:
Hello I am new to internet programming and wonder if anyone can help me with this.... I am trying to pass a hidden field value on a form into another field on the form so that it can then be inserted in the database, to enable me then to reference that number at a later date. (The hidden value (1 for example) would then automatically get passed to the other input field.)
4
3631
by: Magnus Blomberg | last post by:
Hello! I have a problem when using a hidden field to send a value to the server. Below you can see my code in simplyfied versions. What I'm trying to do is: 1. The user browses for a picture at the network from their computer using control File1. 2. The user clickes the button Commit picture (with id CliBtn) a. The script is running at the client to get the sharename of the file
2
2217
by: Bill Steele | last post by:
I want to have a window pop up with a form. When the form is submitted, it needs to pass along the URL of the original window. If find on th web eight gazillion descriptions of how to pass data from one page to another via hidden fields, but not a word about how to pass that data a second time. I find that <SCRIPT LANGUAGE="JavaScript"><!-- document.write(document.referrer);
8
18828
by: =?Utf-8?B?cGVsZWdrMQ==?= | last post by:
i have a GridView and a hidden field : <asp:TemplateField Visible=false > <ItemTemplate > <asp:HiddenField Value="<%#Eval("isActive")%>" id="hidIsActive" runat=server /> </ItemTemplate> </asp:TemplateField> 1)when i check the sorce of html i dont see the hidden field - why is that? 2)on RowDataBound event, when i check the rows i want to check thr above field value,and to do something on certin conditions.
1
7087
by: mark | last post by:
Forgive me if this seems like a stupid question but I need help... I'm trying to do a simple online form that emails me the results from a few fields. Here is the code: <form action="http://cm1web1/WebSurveyComponents/script/ processform.asp" method="post">
2
1963
by: Alexio | last post by:
Sample code snippet - <td align="right">Check Amount:&nbsp;</td> (1) <td><input type="text" name="CHK_input_1" size="19"style="text-align:right" onkeyup="calcCB();" onBlur="currency(this); calcCB();" tabindex="26"> (2) <input type="hidden" name="OBKey__53_1" id="kw_check_amount" > For various database reasons, I need to be able to populate a hidden field to be used as a keyword in our system based on the first...
0
9708
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10589
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10340
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10085
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9161
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7625
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6857
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5663
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2999
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.