Beginner Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOtherBeginner Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old October 7th, 2002, 08:36 AM
diane diane is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: Virginia
Posts: 6 diane User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Keeping values in a form when refreshed

Hi All,
I'm a newbie at web development (oracle DBA by profession) and have been asked to create a web based form that collects user information, looks up info from an access database based on the inputted information and then post all the info back to the access database. i.e user inputs clock number and it does a look up for name, dept, etc..

The form makes several calls back to the database to get additional information. The problem I have is that when the form goes back to the database to get the next item of data whatever was entered by the user previously is cleared out. I have figured out how to retain the information in a text box but can't get the same code to work for a drop down combo box. Any ideas.

I'm developing in front page. The problem item is cboProcessLocation

'Get the information sent to the server via the "GET-like" method of the client in the form of "Request.asp?ClockNum where ClockNum is the field to search on'

strClockNum = Request.QueryString("ClockNum")
strCstCntr = Request.QueryString("CostCen")
strDateNeed = Request.QueryString("DtNeed")
strProblem = Request.QueryString("Problem")
cboProcessLocation= Request.QueryString("Process")



'Build the URL string for the page to load

Function cnonchange()
strEmpID = frm_Maintenance_Request.txtClockNum.value
strCstCntrID = frm_Maintenance_Request.txtCstCntr.value
strDateNeed = frm_Maintenance_Request.txt_Date_Month.value
strProblem =
frm_Maintenance_Request.txt_Problem_Description.value
cboProcessLocation=frm_Maintenance_Request.cboProcessLocation.value
strURL = "http://s38bap06/Request.asp?ClockNum=" & strEmpID & "&CostCen=" & strCstCntrID & "&DtNeed=" & strDateNeed & "&Problem=" & strProblem & "&Process=" & cboProcessLocation
'msgbox strURL
Navigate(strURL)
End Function


Thanks in advace

Reply With Quote
  #2  
Old October 7th, 2002, 01:41 PM
M.Hirsch M.Hirsch is offline
Contributing User
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: Oct 2000
Location: Back in the real world.
Posts: 5,969 M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 22 h 39 m 55 sec
Reputation Power: 184
i donīt know asp nor frontpage, but in html you select a value in a combobox like this:

<select>
<option value="1">One
<option value="2" SELECTED>Two
<option value="3">Three
</select>

so your script needs to output the string "SELECTED" at the right position.
__________________
--
Manuel Hirsch - Linux, FreeBSD, programming, administration articles, tutorials and more.

Reply With Quote
  #3  
Old October 17th, 2002, 06:32 PM
XoG XoG is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Posts: 4 XoG User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 21 m 34 sec
Reputation Power: 0
Lightbulb

hi,
i came across a similar problem not so long ago, i resolved it by generating the entire combo using asp. i defined the items as an array, and looped through it, checking if each item was the selected item, and displaying it with or without the 'selected' property. i expect the code below will be clearer than my rambling....

<select>
<%
dim locations, cboProcessLocation
locations = Array("alpha", "bravo", "charlie", "delta");
cboProcessLocation = request.querystring("process")

for each l in locations
if l = cboProcessLocation then sel = " selected='selected'" else sel = ""
response.write("<option value='" + l + "'" + sel + ">" + l + "</option>")
next

%>
</select>

note : i just bashed that up on the fly, i haven't tested it properly. please repost there is a problem :)

Reply With Quote
Reply

Viewing: Dev Shed ForumsOtherBeginner Programming > Keeping values in a form when refreshed


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway