populate fields from db

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How can I populate other fields from a user option selection? All info is
already in a db. My select code is below. Thanks.

<select name="eventname"
onChange="goType(this.options[this.selectedIndex].value);">
<option value="">Select Physician</option>

<%
sql = "SELECT * from Calendars order by EventName"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open sql, conn, 3, 3
do while not rs.eof
%>
<option name="eventname" value="<%=rs("eventname")%>"><%= rs("eventname")
%></option>

<%
rs.movenext
Loop
%>
<%
rs.close
set rs = nothing
%>
</select>
 
Explain "populate other fields from a user option selection"

Your code displays all records' rs("eventname")%, as options and the JavaScript function goType does something w/ the selection by
user

--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
_____________________________________________


| How can I populate other fields from a user option selection? All info is
| already in a db. My select code is below. Thanks.
|
| <select name="eventname"
| onChange="goType(this.options[this.selectedIndex].value);">
| <option value="">Select Physician</option>
|
| <%
| sql = "SELECT * from Calendars order by EventName"
| Set rs = Server.CreateObject("ADODB.Recordset")
| rs.Open sql, conn, 3, 3
| do while not rs.eof
| %>
| <option name="eventname" value="<%=rs("eventname")%>"><%= rs("eventname")
| %></option>
|
| <%
| rs.movenext
| Loop
| %>
| <%
| rs.close
| set rs = nothing
| %>
| </select>
 
What I desire is to have 3 other fields auto filled in from a table when user
selects from 'eventname'?
 
The easiest way to accomplish this, is to have the user make selection on one page and then post to
another page to populates these additional fields

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================

r_jayson said:
What I desire is to have 3 other fields auto filled in from a table when user
selects from 'eventname'?

Stefan B Rusynko said:
Explain "populate other fields from a user option selection"

Your code displays all records' rs("eventname")%, as options and the JavaScript function goType
does something w/ the selection by
user

--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
_____________________________________________


| How can I populate other fields from a user option selection? All info is
| already in a db. My select code is below. Thanks.
|
| <select name="eventname"
| onChange="goType(this.options[this.selectedIndex].value);">
| <option value="">Select Physician</option>
|
| <%
| sql = "SELECT * from Calendars order by EventName"
| Set rs = Server.CreateObject("ADODB.Recordset")
| rs.Open sql, conn, 3, 3
| do while not rs.eof
| %>
| <option name="eventname" value="<%=rs("eventname")%>"><%= rs("eventname")
| %></option>
|
| <%
| rs.movenext
| Loop
| %>
| <%
| rs.close
| set rs = nothing
| %>
| </select>
 
Back
Top