I need a blank textbox which allow user to select a list of existing records in the database. But if the desired value is not in the database, the user can key in the new value in the blank textbox. This value is to be inserted into the database. I can use "select" to list the values and use "input" to create the blank textbox but I have problems putting these 2 together as one single box.
I am writing it in ASP but not sure if javascript can be implemented from this script?
Here is my code:
I am writing it in ASP but not sure if javascript can be implemented from this script?
Here is my code:
Code:
<form name="insert_subcon_ratings_records" method="Post" action="insert_subcon_ratings_records.asp" onsubmit="return validate_form2(this)">
<table>
<tr><td width=180><font color=red>*</font>Subcontractor Name: </td>
<td>
<select name="NAME">
<%
sql="select DISTINCT NAME from subdb_subcon_rating"
Set rs = OraDatabase.Execute(sql)
response.write ("<option value></option>")
Do While Not rs.EOF
IF Request("sc_name") = rs("NAME") THEN
response.write ("<option value="""&rs("NAME")&""" selected >"&rs("NAME")&"</option>")
ELSE
response.write ("<option value="""&rs("NAME")&""">"&rs("NAME")&"</option>")
END IF
rs.MoveNext
Loop
%>
</select>
<input type=VARCHAR2 name="NAME" size="50">
</td></tr>
</table><br>
<input type="submit" name="submit_subcon_ratings_records" value="Submit Ratings Records">
<input type="reset" name="reset" value="Reset">
</form>