Hello,
I have an evaluation form for managers to evaluate each seller who sells each car. Each seller's name is from the DB
table. Each car may have many sellers.
I am thinking about using JS to disable each seller's name when it is evaluated completely.
For example, there are two sellers (Jenny, Tom) at the drop-down list for Car A, when a manager get finished with "Jenny", then
"Jenny"'s name from the drop-down list is disabled from the list so that the manager can submit evaluation for "Tom".
Can JavaScript handle this type of issue? or it must be done with ASP?
If yes, can you please help?
Thanks.
Code:
<form name="frmSelect" method="Post" action="actionpost.asp" onSubmit="return chForm(this);">
<fieldset>
Select Cars :
<% Set oRs=Server.CreateObject("adodb.recordset")
strSQL = "SELECT DISTINCT Cars FROM tblComboSelect ORDER BY Cars;"
oRs.Open strSQL, myConn
if not oRs.eof then %>
<!--SELECT name="cars" onChange="document.frmSelect.submit()"-->
<SELECT name="cars" onChange="this.form.action='selectcombo1.asp';this.form.submit();">
<OPTION VALUE="1">Select Car</option>
<% do until oRs.EOF %>
<OPTION VALUE="<%= oRS(0) %>" <% if trim(request.form("Cars")) = trim(oRS(0)) then response.write " selected " end if %>><%= oRS(0) %></option>
<% oRs.MoveNext
loop %>
</SELECT>
<% else %>
<i>No Cars found in the database</i>
<% end if %>
<br />
Seller:
<%
strSQL = "SELECT sellerLast, sellerFirst " _
& " FROM tblComboSelect " _
& " WHERE Cars= '" & trim(request.form("Cars")) & "' and DateSold BETWEEN DateAdd('m', -9, Date()) AND Date(); "
Set oRs=Server.CreateObject("adodb.recordset")
oRs.Open strSQL, myConn
if not oRs.eof then %>
<select name="sellers">
<OPTION VALUE="1">Select Seller</option>
<% do until oRs.eof %>
<option value="<%= oRs("sellerLast") %>, <%= oRs("sellerFirst") %>"><%= oRs("sellerLast") %>, <%= oRs("sellerFirst") %></option>
<% oRs.MoveNext
loop %>
</select>
<% else %>
<i>No records found for that car</i>
<% end if %>
<br />
Customer's comments:
<textarea rows="2" cols="50" name="Comments" id="com"></textarea>
</fieldset>
<p><input name="btnSubmit" type="submit" value="Submit">
<input type="reset" name="Reset" value="Clear Form"></p>
</form>