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 2 of 2
  1. #1
    New Coder
    Join Date
    Sep 2007
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Major Skills: using iframes

    i'm having trouble passing search terms from a search box to an iframe.
    when ever the quotation marks go around the search (with input text name=q) and are passed on to the iframe with <iframe src="http://google.com/search?q=<%=Request("q") %> i get a msg saying the page cannot be displayed.

    i'm guessing since Request("q") already has quotation marks it won't allow the contents of 'q' to have quotation marks.

    Is there any other way to request the text that was input so that the quotation marks are recognized by google in the iframe?

  • #2
    Regular Coder
    Join Date
    Mar 2007
    Posts
    505
    Thanks
    1
    Thanked 19 Times in 19 Posts
    Try:

    Code:
    <iframe src="http://google.com/search?q=<%=Request.form("q") %>">
    While Request and Request.form are similar, they are not the same.

    Here's some test code that does work so that you can have another example.

    Code:
    <body>
    <form method="post" action="test.asp">
    <input type="text" name="q" size="30" /><br />
    <input type="submit" name="B1" value="Search Google!" /><br />
    </form>
    <iframe src="http://www.google.com/search?q=<%= request.form("q") %>" frameborder="0" width="98%" height="400"></iframe>
    </body>
    To say my fate is not tied to your fate is like saying, 'Your end of the boat is sinking.' -- Hugh Downs
    Please, if you found my post helpful, pay it forward. Go and help someone else today.


  •  

    Posting Permissions

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