By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,647 Members | 1,178 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,647 IT Pros & Developers. It's quick & easy.

show value in text box

P: n/a
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.

<%@ 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>

Dec 7 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
<input type="text" value="<%=Server.HTMLEncode(yourValue)%>">

Ray at work

<ni******@yahoo.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
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.


Dec 7 '05 #2

P: n/a
thnaks I got it,

Dec 7 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.