Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder luigicannavaro's Avatar
    Join Date
    Aug 2007
    Posts
    150
    Thanks
    11
    Thanked 0 Times in 0 Posts

    Question Tag as input text

    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

  • #2
    Senior Coder
    Join Date
    Oct 2008
    Location
    Long Beach
    Posts
    1,196
    Thanks
    36
    Thanked 164 Times in 164 Posts
    Please show the rest of your code (asp included) and wrap the value attribute in quotes.
    Feel free to e-mail me if I forget to respond ;)
    ohsosexybrit@gmail.com

  • #3
    Regular Coder luigicannavaro's Avatar
    Join Date
    Aug 2007
    Posts
    150
    Thanks
    11
    Thanked 0 Times in 0 Posts
    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

  • #4
    Senior Coder
    Join Date
    Oct 2008
    Location
    Long Beach
    Posts
    1,196
    Thanks
    36
    Thanked 164 Times in 164 Posts
    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:
    Code:
    <input type="text" name="what" value="<%response.write(strkeyword)%>" >
    Last edited by itsallkizza; 12-20-2008 at 10:34 PM.
    Feel free to e-mail me if I forget to respond ;)
    ohsosexybrit@gmail.com

  • #5
    Regular Coder luigicannavaro's Avatar
    Join Date
    Aug 2007
    Posts
    150
    Thanks
    11
    Thanked 0 Times in 0 Posts
    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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •