Page 1 of 2 12 LastLast
Results 1 to 15 of 18

Thread: Form Question

  1. #1
    Quack Shlup's Avatar
    Join Date
    Aug 2000
    Location
    California
    Posts
    34,993
    Articles
    14
    Blog Entries
    37
    Contributions
    • Former Administrator
    • Former Cid's Knight

    Default Form Question

    I've added a search form to my site, but I want it to open a new window when you hit the "go" button. I tried just adding target="_blank" to the code, but it dinnae work. Why dinnae it work? ;_;

  2. #2
    Hypnotising you crono_logical's Avatar
    Join Date
    May 2001
    Location
    Back in Time
    Posts
    9,313
    Contributions
    • Former Administrator
    • Former Cid's Knight

    Default

    I think target="_blank" only works in anchor tags, and not in form submit buttons, as far as I know
    Problems playing downloaded videos? Try CCCP


  3. #3
    Quack Shlup's Avatar
    Join Date
    Aug 2000
    Location
    California
    Posts
    34,993
    Articles
    14
    Blog Entries
    37
    Contributions
    • Former Administrator
    • Former Cid's Knight

    Default

    Obviously, otherwise it would have worked when I did it.

    That's two threads in a row you didn't immediatly solve my problem. You're losing your touch!

  4. #4
    Prinny God Recognized Member Endless's Avatar
    Join Date
    Aug 2000
    Location
    Prinny Moon
    Posts
    2,641
    Contributions
    • Former Cid's Knight

    Default

    Use JavaScript to open a new window onClick:
    http://www.pageresource.com/jscript/jwinopen.htm

    And then there is Death

  5. #5
    Old school, like an old fool. Flying Mullet's Avatar
    Join Date
    Apr 2003
    Location
    Napping in a peach tree.
    Posts
    19,185
    Articles
    6
    Blog Entries
    7
    Contributions
    • Former Administrator
    • Former Cid's Knight
    • Former Senior Site Staff

    Default

    Munty didn't solve the problem?

    My world is crumbling around me...
    Figaro Castle

  6. #6
    Quack Shlup's Avatar
    Join Date
    Aug 2000
    Location
    California
    Posts
    34,993
    Articles
    14
    Blog Entries
    37
    Contributions
    • Former Administrator
    • Former Cid's Knight

    Default

    Alright, maybe I'm just too tired but, Raf, what do I change this button code to to make the java opening crap work?

    <*input type="image" border="0" value="Go" name="Submit" src="ap-search-go-btn.gif"align="absmiddle" width="21" height="21" />

  7. #7
    Banned Sepho's Avatar
    Join Date
    Jan 2003
    Location
    Twilight Zone
    Posts
    1,812
    Articles
    8

    Default

    <*input type="image" border="0" value="Go" name="Submit" src="ap-search-go-btn.gif" align="absmiddle" width="21" height="21" onClick="window.open('<i>yourpage</i>.html','mywindow','width=<i>width</i>,height=<i>height</i>')" />

    <i>yourpage</i> is the filename of the page you want to open in the new window.
    <i>width</i> and <i>height</i> are the, well, desired width and height of the javascript-generated window
    I wouldn't pay attention to the "mywindow" part. It's the name of the window, and it's probably not a big deal for what you're using it for. You can change it to whatever you want.

  8. #8
    Quack Shlup's Avatar
    Join Date
    Aug 2000
    Location
    California
    Posts
    34,993
    Articles
    14
    Blog Entries
    37
    Contributions
    • Former Administrator
    • Former Cid's Knight

    Default

    That's the thing. I don't know what to put for your page. Its an Amazon.com search field, so I'm not opening a particular page, its submitting a search.

  9. #9
    Banned Sepho's Avatar
    Join Date
    Jan 2003
    Location
    Twilight Zone
    Posts
    1,812
    Articles
    8

    Default

    So the <*form action="something that's hosted on Amazon" />, and you want the search results to open in a new window? I'm not sure if you can do that, because the search results page is actually the script in the <i>action</i> property of the <i>FORM</i> tag. You may have to mess with the <i>FORM</i> and not the <i>INPUT</i> tag. You could try substituting <i>yourname</i> with the name of the script (it's linked to in < FORM action="<i>script</i>" ). That probably made next to no sense.

    Try posting the code from < form> to </ form> so we can look through it. I think whether the results are opened in a new window is controlled within the actual script. Hopefully I'm just missing something really simple and obvious. Sorry I couldn't be of more help.

  10. #10
    Quack Shlup's Avatar
    Join Date
    Aug 2000
    Location
    California
    Posts
    34,993
    Articles
    14
    Blog Entries
    37
    Contributions
    • Former Administrator
    • Former Cid's Knight

    Default

    Here's what Amazon gave me:

    http://www.questw0rld.com/code.txt

  11. #11
    Prinny God Recognized Member Endless's Avatar
    Join Date
    Aug 2000
    Location
    Prinny Moon
    Posts
    2,641
    Contributions
    • Former Cid's Knight

    Default

    I looked at your site since that bit of code is unhelpful
    Try changing <*form action="http://www.amazon.com/exec/obidos/external-search"> into <*form action="http://www.amazon.com/exec/obidos/external-search" target="_blank">

    And then there is Death

  12. #12
    Banned Sepho's Avatar
    Join Date
    Jan 2003
    Location
    Twilight Zone
    Posts
    1,812
    Articles
    8

    Default

    That's what I was going to suggest, but I figured the target property wasn't (and probably isn't) applicable to the FORM tag.

    I too had a look at the frame source, and nothing helped. I looked around Amazon for a section about their site searches, but I couldn't find anything. Maybe there's a hidden input type that controls whether the form opens in a new window?

  13. #13
    Prinny God Recognized Member Endless's Avatar
    Join Date
    Aug 2000
    Location
    Prinny Moon
    Posts
    2,641
    Contributions
    • Former Cid's Knight

    Default

    You can use target in a form tag. Example:
    &lt;form action="usercp.php?" target="_new">
    &lt;input type="submit" value="Open the User CP in a new window">
    &lt;/form>
    <form action="usercp.php?" target="_new">
    <input type="submit" value="Open the User CP in a new window">
    </form>

    And then there is Death

  14. #14
    Banned Sepho's Avatar
    Join Date
    Jan 2003
    Location
    Twilight Zone
    Posts
    1,812
    Articles
    8

    Default

    Wonderful.

    I suppose I could have just tested it instead of wondering .

  15. #15
    Quack Shlup's Avatar
    Join Date
    Aug 2000
    Location
    California
    Posts
    34,993
    Articles
    14
    Blog Entries
    37
    Contributions
    • Former Administrator
    • Former Cid's Knight

    Default

    RAF WINS! *does a dance*

Posting Permissions

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