Advertisement

09.04.2008 at 07:46AM PDT, ID: 23702831
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.0

Saving values in controls during submit.

Asked by flfmmqp in Active Server Pages (ASP), JavaScript

I have a textarea box (Textarea3) and a option box (ddlYear) that I need to keep the value of during a submit of the form.  I'm not sure how to keep the value, if entered, in these controls.  Below are the example controls that I need help with.  

Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
<%@ Language = VBScript %>
 
<%Option Explicit%>
 
<%Response.Buffer = True%>
 
<HTML>
 
<HEAD>
 
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
 
<TITLE></TITLE>
<%
dim strDataPath, strConnectString, objConnection
dim strDivision, strMarket, strCity, objRS, strSelected, strSQL
strDivision = Request.Form("ddlDivision")
strMarket = Request.Form("ddlMarket")
'set connection strings for entire application
strDataPath = server.MapPath("/Databases/CompEvents.mdb")
strConnectString = "Provider=Microsoft.Jet.OLEDB.4.0;"_
            + " Data Source= " & strDataPath & ";"_
            + " Mode=Share Deny None;User Id=admin;PASSWORD=;"
 
if not IsObject("ojbConnection") then
    set objConnection=Server.CreateObject("ADODB.Connection")
    objConnection.ConnectionTimeout = 15
    objConnection.CommandTimeout = 10
    objConnection.Mode = 3 'adModeReadWrite 
    if objConnection.state = 0 then
        objConnection.Open strConnectString
    end if
end if
 
sub makeDivision()
 
    if not isObject("objRS") then
        set objRS=Server.CreateObject("ADODB.RecordSet")
    end if
    if objRS.state <> 0 then
        objRS.close
    end if
    //strSQL = "SELECT Dmas.Division, Dmas.DMAID, Dmas.DMANAME FROM Dmas GROUP BY Dmas.Division, Dmas.DMAID, Dmas.DMANAME HAVING (((Dmas.Division)<>'MCF')) ORDER BY Dmas.Division;"
    strSQL = "SELECT DMAS.Division FROM DMAS GROUP BY DMAS.Division;"
    objRS.Open strSQL,objConnection,3,3
    Response.Write("<option></option>" & VBCRLF )
    do while not objRS.EOF
        if objRS("Division") = strDivision then
            strSelected = " Selected "
        else
            strSelected = ""
        end if
        Response.Write("<option" & strSelected & ">" &_
                 objRS("Division") & "</option>" & VBCRLF )
        objRS.MoveNext
    loop
    objRS.Close
    set objRS=Nothing
end sub
 
sub makeMarket()
    if strDivision <> "" then
        if not isObject("objRS") then
            set objRS=Server.CreateObject("ADODB.RecordSet")
        end if
        if objRS.state <> 0 then
            objRS.close
        end if
    //strSQL = "SELECT Dmas.Division, Dmas.DMAID, Dmas.DMANAME FROM Dmas GROUP BY Dmas.Division, Dmas.DMAID, Dmas.DMANAME HAVING (((Dmas.Division)<>'" & strDivision & "')) ORDER BY Dmas.DMANAME;"
    strSQL = "SELECT DMAS.DMANAME FROM DMAS WHERE (((DMAS.Division)='" & strDivision & "')) ORDER BY DMAS.DMANAME;"
 
        objRS.Open strSQL,objConnection,3,3
        if objRS.eof then
            Response.Write("<option>No Markets Found</option>")
        else
            Response.Write("<option>Select Market Now</option>" & VBCRLF )
            do while not objRS.EOF
                if objRS("DMANAME") = strMarket then
                    strSelected = " Selected "
                else
                    strSelected = ""
                end if
                Response.Write("<option" & strSelected & ">" &_
                         objRS("DMANAME") & "</option>" & VBCRLF )
                objRS.MoveNext
            loop
        end if
        objRS.Close
        set objRS=Nothing
    else
        Response.Write("<option>Select a Division First</option>")
    end if
end sub
%>
 
<SCRIPT LANGUAGE=javascript>
 
<!--
function submitDivision(){
    var objForm = document.forms[0];
    objForm.elements['ddlMarket'].selectedIndex=0;    
    objForm.submit();
}
 
function submitMarket(){
    var objForm = document.forms[0];
    objForm.submit();
}
 
//-->
</SCRIPT>
</HEAD>
<BODY onLoad="window.moveTo(0,0);window.resizeTo(400,400);">
 
<FORM action="" method=POST id=form1 name=form1 onSubmit="return submitForm()">
<SELECT name="ddlDivision" onChange="submitDivision()">
    <%call makeDivision%>
</SELECT><br>
 
<SELECT name="ddlMarket">
    <%call makeMarket%>
</SELECT>
    <input id="txtusername" name="username" style="width: 164px; background-color: yellow"  tabindex="0" type="text" value='<%=Request("username")%>'/>
 
 
                   <select size="1" name="completionyear" style="width: 170px; background-color: yellow;" id="ddlYear" onchange="CheckYear()" tabindex="1">
                        <option value="0">-- Select Year --</option>
                        <option value="unknown">unknown</option>                    
                        <% DIM intYearCounter, intCurrentYear %>
                        <% intCurrentYear = Year(Date) %>
                        <% FOR intYearCounter = intCurrentYear TO (intCurrentYear + 5) %>
                        <% Response.Write "<option>" & CStr(intYearCounter) & "</option>" %>
                        <% NEXT %>
                    </select>
 
 
                    <textarea id="Textarea3"   value='<%=Request("source")%>' rows="2" style="width: 551px" name="source" tabindex="30"></textarea></td>
 
 
    <input id="Submit1" type="submit" value="submit" />
</FORM>
</BODY>
<%
objConnection.Close
set objConnection = Nothing
%>
</HTML>
[+][-]09.04.2008 at 07:55AM PDT, ID: 22388112

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.04.2008 at 07:56AM PDT, ID: 22388119

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.04.2008 at 07:58AM PDT, ID: 22388165

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.04.2008 at 08:00AM PDT, ID: 22388197

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.04.2008 at 08:02AM PDT, ID: 22388218

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.04.2008 at 08:02AM PDT, ID: 22388221

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.04.2008 at 08:04AM PDT, ID: 22388256

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Active Server Pages (ASP), JavaScript
Sign Up Now!
Solution Provided By: hielo
Participating Experts: 3
Solution Grade: A
 
 
[+][-]09.04.2008 at 10:16AM PDT, ID: 22390018

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628