View Full Version : Tag as input text

12-16-2008, 07:10 PM

I have the following input:

<input type="text" name="what" value=<%response.write strkeyword%> >

However it not works. Works just when I put manually the value. Can I automatically input the text value or not?

Best regards


12-16-2008, 07:39 PM
Please show the rest of your code (asp included) and wrap the value attribute in quotes.

12-20-2008, 02:52 PM

My html page:

<form type="get" action="ECONOMICS.asp" onSubmit="return verifica(this);" >

<input type="text" name="look_for" value= "">
<input type="submit" value="Go!" style="height : 25; width : 30;" onClick="makeWord(this.form.look_for) >
<input type="reset" value="Clear" style="height : 25; width : 40;">


my asp.page

DIM strKeyword, strKeyword2
strKeyword = Request.QueryString("look_for")

strKeyword2 = replace(strkeyword, " ", "','" )

strConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _

Set conn = Server.CreateObject("ADODB.Connection")
conn.Open strConnection

Set rs = Server.CreateObject("ADODB.recordset")

rs.open " select * from ECONOMICS WHERE keywords.Word IN ('" & StrKeyword2 & "') ", conn

do until Rs.EOF

<textarea cols=50 rows=10><%RESPONSE.WRITE RS.FIELDS("WORD") %></textarea>
<input type="text" name="what" value=<%response.write strkeyword%> >
<input type=submit value="go">

<% Rs.close%>
<% conn.close%>

Best regards


12-20-2008, 11:31 PM
Hm... It looks like it should be working to me. Sadly I don't have access to an ASP server here at home so I'll take another look for you monday (so I can actually debug it).

One quick question though. I've always wrapped function call parameters in parentheses. Is this not necessary? (I'm guessing resonse.write is a native function rather than a native sub, or else you'd have to use the "call" keyword in front of it if you did use parentheses.) Also wrap that value in quotes or you could run into trouble in your html:

<input type="text" name="what" value="<%response.write(strkeyword)%>" >

12-21-2008, 12:34 PM

Today I am putting in order my js files and .asp files.... I saw that www.codingforums.com vahe deleted old thread (more than 2 years old)... and unfortunately my bag of old threads were in other side of the Atlantic Ocean where the sands are brilliant, the Sun are hot and the girls are very, very beatiful.

Well.. your code works fine!