...

View Full Version : Tag as input text



luigicannavaro
12-16-2008, 07:10 PM
Hello,

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

Luigi

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

luigicannavaro
12-20-2008, 02:52 PM
Ok.

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;">

</form>


my asp.page





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

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

strConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
Server.MapPath(".\db\ECONOMICSTHEORY.mdb")

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

<form>
<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">
</form>

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


Best regards

Luigi

itsallkizza
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)%>" >

luigicannavaro
12-21-2008, 12:34 PM
Well,

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!

Thanks

Luigi



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum