|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
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. |
|
#3
|
|||
|
|||
|
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 :) |
![]() |
| Viewing: Dev Shed Forums > Other > Beginner Programming > Keeping values in a form when refreshed |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|