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

Retaining form values inside the display of select pulldown boxes

I have a select-pulldown at http://computergroupplays.com/fb-pres2.asp
that changes the 3rd pulldown (Dbase) depending on what the user
enters in the 2nd (Wk). My associate wants the values inside the
select box to retain their values after hitting the Go-Submit button
when selecting the 3 choices- they want to see the values retained on
the next page when you look at the form. Below is the include file
used to generate the dynamic pulldown value for the 3rd pulldown:

<script language="Javascript">

var arrayData = new Array();

arrayData[0] = '1|LY-YrToDate|'
arrayData[1] = '1|LY-Last8wk|'
arrayData[2] = '2|LY-YrToDate|'
arrayData[3] = '2|LY-Last8wk|'
arrayData[4] = '3|Avg(YrTD-LY)|'
arrayData[5] = '4|YrToDate|'
arrayData[6] = '5|YrToDate|'
arrayData[7] = '6|YrToDate|'
arrayData[8] = '7|YrToDate|'
arrayData[9] = '8|YrToDate|'
arrayData[10] = '8|Rolling-6wk|'
arrayData[11] = '9|YrToDate|'

function populateData( name ) {

select = window.document.form.DBCode;
string = "";

// 0 - will display the new options only
// 1 - will display the first existing option plus the new options

count = 0;

// Clear the old list (above element 0)

select.options.length = count;

// Place all matching categories into Options.

for( i = 0; i < arrayData.length; i++ ) {
string = arrayData[i].split( "|" );
if( string[0] == name ) {
select.options[count++] = new Option( string[1] );
}
}
}

</script>

===
.....and the html in the form:
<form name="form" method="post" action="fb-query-post6.asp">
<td height="114" valign="top"
background="images/wayback.jpg" width="359"><p><br>
&nbsp;&nbsp;<br>
&nbsp;</p>
<p> &nbsp;<font color="#FF9900" size="2">Yr</font>
<select name="season" STYLE="font-family : monospace;
font-size : 7.5pt"><option></option>
<option value="2003">2003</option>
<option value="2002">2002</option>
<option value="2001">2001</option>
</select>
<font color="#FF9900" size="2">Wk#</font>
<select name="gameweek" size=1 STYLE="font-family :
monospace;
font-size : 7.5pt"
onChange='javascript:populateData(
this.options[selectedIndex].text )'>
<option></option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>

</select>
&nbsp; <font color="#FF9900" size="2">DBase
<select name="DBCode" STYLE="font-family : monospace;
font-size : 7.5pt">
</select>
&nbsp;<input name="submit" type="submit" class="inputSubmit"
value="Go" size="8" align="absbottom">
</form>

using option value "selected" gives this scenario problems. Any remedy
into what I'm suggesting, or is it possible?

thx
Cgplays.com
Jul 20 '05 #1
1 6602
> I have a select-pulldown at http://computergroupplays.com/fb-pres2.asp
that changes the 3rd pulldown (Dbase) depending on what the user
enters in the 2nd (Wk). My associate wants the values inside the
select box to retain their values after hitting the Go-Submit button
when selecting the 3 choices- they want to see the values retained on
the next page when you look at the form. Below is the include file
used to generate the dynamic pulldown value for the 3rd pulldown:


Perhaps I missed something you asked but in case I didn't:
You have a function that changes the value of Dbase when Wk selected.
Pass the value of Wk to the 'next page.'
Include the function (that changes Dbase) in the 'next page' and run
it when the page opens. It will then set Dbase on the 'next page' the
same way it did on the first page because you are passing it the same
value you did the first time.
HTH
Pachydermitis
Jul 20 '05 #2

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

Similar topics

3
by: Mark R | last post by:
I have one .asp page with a SELECT pulldown list on it and some INPUT fields. When SUBMIT is clicked the form data is submitted to that same page and validated. If INPUT fields are empty the asp...
1
by: J. Muenchbourg | last post by:
I have 3 select pulldown boxes where a user will select a year (either 2002 or 2001), a week (one thru 52), and a database (short data or long data). But if a user selects a week that is less than...
1
by: Scott Medaugh | last post by:
Hello, I am trying to do something unusual and it has me stumped. I am looking to change the Env variable for RemoteUser essentially. What I would like to happen is that the user would choose...
2
by: Sean | last post by:
Greetings all, I am attempting to make a form that will filter through several tables that (I believe) have refretial integrity. I am pulling data from several tables into the form and i would...
0
by: loga123 | last post by:
Hi All, I am very new to .net and trying to develop a small application. I am using asp .net 2.0. I have a table control (server) in my code that has header row like this. <asp:Table...
2
by: assgar | last post by:
Hi Developemnt on win2003 server. Final server will be linux Apache,Mysql and PHP is being used. I use 2 scripts(form and process). The form displays multiple dynamic rows with chechboxs,...
18
ak1dnar
by: ak1dnar | last post by:
Hi, I have created a web application that enables to Delete Items in a product table using check boxes. I Need to Display each and every product in <TR> and with the product there is a corresponding...
3
by: =?Utf-8?B?ZGVuIDIwMDU=?= | last post by:
Hi, Trouble in retaining values of dropdownlist, textboxes, and other controls when dropdownlist selectedindexchanged event is triggered, the controls are inside a user control and this user...
2
by: anusha.vempati9 | last post by:
Hi All, I am calling a cgi file from a perl module. The cgi file contains the HTML form and some HTML fields(like check boxes). In my logic, I am trying to submit the form and calling the same...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
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
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...

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.