Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Selcting from drop-down and if not present force user to enter new...

Status
Not open for further replies.

TonyU

Technical User
Joined
Feb 14, 2001
Messages
1,317
Location
US
[tt]Hello all, I'm trying to add vbscript code to my page that would allow the user to enter a new client if not found in the database drop-down box but don't know where to start... I would greatly appreciate you helping me with either code or where I can educate myself on how it's done.

Thanks


here's the form I'm currently using
<form method=&quot;post&quot; action=&quot;<%=MM_editAction%>&quot; name=&quot;form1&quot;>
<table align=&quot;left&quot; class=&quot;body&quot;>
<tr valign=&quot;baseline&quot;>
<td nowrap align=&quot;right&quot;>Bid Date: </td>
<td colspan=&quot;2&quot;>
<input type=&quot;hidden&quot; name=&quot;biddate&quot; value=&quot;<%=date()%>&quot; size=&quot;32&quot;>
<%=date()%> </td>
</tr>
<tr valign=&quot;baseline&quot;>
<td nowrap align=&quot;right&quot;>Entered By: </td>
<td colspan=&quot;2&quot;>
<input type=&quot;hidden&quot; name=&quot;enteredby&quot; value=&quot;<%=request.cookies(&quot;user&quot;)(&quot;firstname&quot;)%> <%=request.cookies(&quot;user&quot;)(&quot;lastname&quot;)%>&quot; size=&quot;32&quot;>
<%=request.cookies(&quot;user&quot;)(&quot;firstname&quot;)%> <%=request.cookies(&quot;user&quot;)(&quot;lastname&quot;)%> </td>
</tr>
<tr valign=&quot;baseline&quot;>
<td nowrap align=&quot;right&quot;>Bid Number: </td>
<td colspan=&quot;2&quot;>
<input type=&quot;text&quot; name=&quot;bidnumber&quot; value=&quot;&quot; size=&quot;20&quot;>
</td>
</tr>
<tr valign=&quot;baseline&quot;>
<td nowrap align=&quot;right&quot;>Client: </td>
<td>
<select name=&quot;client_id&quot;>
<option value=&quot;-------&quot;>Select the Client</option>
<%
While (NOT rsClients.EOF)
%>
<option value=&quot;<%=(rsClients.Fields.Item(&quot;client_id&quot;).Value)%>&quot; ><%=(rsClients.Fields.Item(&quot;client_name&quot;).Value)%></option>
<%
rsClients.MoveNext()
Wend
If (rsClients.CursorType > 0) Then
rsClients.MoveFirst
Else
rsClients.Requery
End If
%>
</select>
</td>
<td> </td>
</tr>
<tr valign=&quot;baseline&quot;>
<td nowrap align=&quot;right&quot;>Project Name: </td>
<td colspan=&quot;2&quot;>
<input type=&quot;text&quot; name=&quot;project&quot; value=&quot;&quot; size=&quot;50&quot;>
</td>
</tr>
<tr valign=&quot;baseline&quot;>
<td nowrap align=&quot;right&quot;> </td>
<td colspan=&quot;2&quot;>
<input type=&quot;submit&quot; value=&quot;Insert Record&quot;>
<input type=&quot;reset&quot; name=&quot;Reset&quot; value=&quot;Clear&quot;>
<input type=&quot;hidden&quot; name=&quot;status&quot; value=&quot;New&quot; size=&quot;32&quot;>
</td>
</tr>
</table>
<input type=&quot;hidden&quot; name=&quot;MM_insert&quot; value=&quot;true&quot;>
</form>


P.S. My idea was to have the user either click a checkbox or button to add the new client in a pop-up window or something like that. (but I'm sure there's an easier way)

Please advice...




T ® Ñ ¥
To keep a lamp burning we have to keep puting oil in it.
logo.gif

 
[tt]
I meant to post this in the VBScript forum, but If you JS gurus can help on this I would appreciate it.

I'd hate to post it in two forums.. Thanks



T ® Ñ ¥
To keep a lamp burning we have to keep puting oil in it.
logo.gif

 
there's no standard html element that allows the behavior of both a select list and a text input.

one way is to use a select and a text input, and have radio buttons assigned to them...

(radio) [select client V]
(radio) [enter new client]

depending on which radio is checked will determine which value you use on the server side.

 
[tt]Thanks for your response jemminger, think I'm going a different route for this one. thanks


T ® Ñ ¥
To keep a lamp burning we have to keep puting oil in it.
logo.gif

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top