display value in textbox

N

nikou_70

I have a page with one text box when I search name, return value such
as (address, phone...) I show these value in the table but I want to
show these in text box that I have in my page.
this is my page,
<%@ Language=VBScript %>
<%
set conn=server.CreateObject ("adodb.connection")
connect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
Server.MapPath("customer.mdb") & ";Persist Security Info=False"
conn.Open connect
%>
<html>
<head>
<script language="javascript">
<!--
function dept_onchange(frmSelect) {
document.frmSelect.submit();
}

//-->
</script>
</head>
<body>
<form name="frmSelect" method="Post" action="search.asp">
Name:<input type=text name=print
onchange="dept_onchange(frmSelect);" />
<%
a=Request.Form ("print")
if a<> "" then
sqlstr2="select * from Ticket where Name='" & a & "'"
set ors = conn.Execute(sqlstr2)

if ors.eof=true and ors.bof=true then
Response.Write "<br><b>No Records Matched.</b>"
else
numfields=ors.fields.count
Response.Write "<table border=1 width=100% bgcolor=#c1e0ff >"
Response.Write "<tr>"
for i=0 to numfields-1

Response.Write "<td><font color=CornflowerBlue face=arial
size=2><b>" & ors(i).name & "</font></b></td>"
next
Response.Write "</tr>"
ors.movefirst
do while not ors.eof
Response.Write "<tr>"
for i=0 to numfields-1

Response.Write "<td valign=top><font color=#000099 face=arial
size=2><b>" & ors.fields(i).value & "&nbsp;</font></b></td>"
next
Response.Write "</tr>"
ors.movenext
loop
'******************
Response.Write "</table>"
end if
end if
%>
<table border="1">
<tr>
<td>
<font size="2" face="arial" color="#339966"><strong><em>
Name: </em></strong>
</font></td>
<td align="right" style="width: 184px">
<p><input name="Name" maxlength="25">
</td>
<td align="right" style="width: 184px; text-align: left">
<span style="font-size: 14pt"><p>+</p></span></td>
</tr>
<tr>
<td>
<font size="2" face="arial" color="#339966"><strong><em>
Address:</em></strong>
</font></td>
<td align="right" style="width: 183px">
<p>
<input name="Address">

</td>
<td align="right" style="width: 183px">
</td>
</tr>
<tr>
<td>
<font size="2" face="arial" color="#339966"><strong><em>
Phone: </em></strong>
</font></td>
<td align="right" style="width: 183px">
<p><INPUT TYPE="text" NAME="Phone" mask="(###)-###-####"
onblur="return onBlurMask(this);" onfocus="return onFocusMask(this);"
onkeydown="return doMask(this);" style="width: 155px"></td>
<td align="right" style="width: 183px">
</td>
</tr>
<tr>
<td>
<font size="2" face="arial" color="#339966"><strong><em>
Status:</em></strong>
</font></td>
<td align="right" style="width: 183px">
<p>

<input name="status" style="width: 183px">

</td>
<td align="right" style="width: 183px">
</td>
</tr>
<tr>
<td>
<font size="2" face="arial" color="#339966"><strong><em>
comment:</em></strong>
</font></td>
<td style="width: 184px">
<p>
<textarea name="comment" style="width: 183px"></textarea>
</td>
<td style="width: 184px">
</td>
</tr>
<tr>
<td>
</td>
<td align="right" style="width: 184px">
<font size="2" face="arial" color="yellow">
<input type="Button" value="Save" id="submit1" name="submit1" >
<input type="reset" id="reset1" name="reset1">&nbsp;</font>
</td>
<td align="right" style="width: 184px">
</td>
<td>
&nbsp;</td>
</table>
</form>
</td>
<tr>
</tr>
<tr>
</tr>
</table>
</form>

</body>
</html>
 
S

Slim

If I understand correctly you simply want to present values from your server
asp to your text box

<input type=text name=print onchange="dept_onchange(frmSelect);"
value="<%=someValue%>" >

where somevalue is a variable in your asp server code
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top