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

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=JavaScript>
<!--
function ch_price (theForm) {
for (i=0; i < <%=(rsSaleC.Fields.Item('prodC').Value)%>; i++){

document.form1.price.value =
document.form1.size.options[document.form1.size.selectedIndex].value;

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

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

</SCRIPT>
and in the body
<select name="size" id="size" onChange="ch_price(form1)">
<option selected
value="<%=(rsDisplay.Fields.Item("Price").Value)%> ">Select
Size/Colour</option>

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

<%
rsSale.MoveNext();
}
if (rsSale.CursorType > 0) {
if (!rsSale.BOF) rsSale.MoveFirst();
} else {
rsSale.Requery();
}
%>

does any one have any ideas?
Jul 23 '05 #1
1 2188
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=JavaScript>
<!--
function ch_price (theForm) {
for (i=0; i < <%=(rsSaleC.Fields.Item('prodC').Value)%>; i++){

document.form1.price.value =
document.form1.size.options[document.form1.size.selectedIndex].value;

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

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

</SCRIPT>
and in the body
<select name="size" id="size" onChange="ch_price(form1)">
<option selected
value="<%=(rsDisplay.Fields.Item("Price").Value)%> ">Select
Size/Colour</option>

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

<%
rsSale.MoveNext();
}
if (rsSale.CursorType > 0) {
if (!rsSale.BOF) rsSale.MoveFirst();
} 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
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...
1
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...
3
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...
4
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...
4
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...
2
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...
8
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>...
1
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...
2
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();"...
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
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
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,...
0
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...
0
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...

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.