I have a customer that wants to link a search page to his site, the problem is he wants to display a particular page that is dynamically generated by the search page. (he seems to think, you just copy and paste the generated URL to the href)
So what I need to be the hero is….
The javascript to place text into a page text field then submit.
I can’t and don’t intend to create the script myself, and I’m having a hard time choosing the correct words to do a proper search.
I know, I should learn this stuff myself, but he is the only client that I do web work for…
Place Text in Page you Link to
Krom, this is the site my client wants to link to:
http://www.brandbookonline.com/cgi-bin/ ... arget=main
But this is not the “page” he wants to display, he wants “bayside” to display. (the pages are created dynamically, so of course a link to the bayside page is not possible)
So what I need is this in Java…(I am assuming Java)
1. Go to that URL (the brandbook search page)
2. Enter the word “bayside” into the search field
3. Enter
4. Display the resulting page
I need to put that in a HTML page I can point a link to it from inside a flash graphic, so I don’t have the option to place the code in the page with the link. Unless it’s something that can simply be added to the end of a hyperlink.
If this is not possible or would take too much time to debug, just let me know.
http://www.brandbookonline.com/cgi-bin/ ... arget=main
But this is not the “page” he wants to display, he wants “bayside” to display. (the pages are created dynamically, so of course a link to the bayside page is not possible)
So what I need is this in Java…(I am assuming Java)
1. Go to that URL (the brandbook search page)
2. Enter the word “bayside” into the search field
3. Enter
4. Display the resulting page
I need to put that in a HTML page I can point a link to it from inside a flash graphic, so I don’t have the option to place the code in the page with the link. Unless it’s something that can simply be added to the end of a hyperlink.
If this is not possible or would take too much time to debug, just let me know.
- Krom
- DBB Database Master
- Posts: 16138
- Joined: Sun Nov 29, 1998 3:01 am
- Location: Camping the energy center. BTW, did you know you can have up to 100 characters in this location box?
- Contact:
That would be way too much work to actually go parsing the page and entering something in then triggering the search (and it would likely annoy any number of security settings and programs). What you would really want to do is find out what the browser sends the server when you search for \"bayside\" and simply repeat that exact same request directly from whatever page you are working on.
But if it is just the bayside brand you are trying to link to use this:
http://www.brandbookonline.com/cgi-bin/ ... sor=000004
All I had to do to get there was click Brands down on the bottom navigation and then click bayside. Will that work for you?
But if it is just the bayside brand you are trying to link to use this:
http://www.brandbookonline.com/cgi-bin/ ... sor=000004
All I had to do to get there was click Brands down on the bottom navigation and then click bayside. Will that work for you?
Exactly, cross-domain javascript is a no-no on browsers. If you could put javascript on your server that could do stuff on other domains, then, if you could fill out a search form on someone else's site, then you could fill out a delete account form on someone else's site, or send their account info on that site back to your server, etc.Krom wrote:(and it would likely annoy any number of security settings and programs)
- Testiculese
- DBB Material Defender
- Posts: 4689
- Joined: Sun Nov 11, 2001 3:01 am
You can do this without too much trouble. You can do this with 99% of search forms out there.
I put Google's search on my own local homepage. I type in my query, click the button, and it sends that to Google, which then gives me a list of the results.
To do this, I loaded Google's homepage (google.com), then went to View Page Source. I did a search for <form and found the form tag for the textbox. I pulled the whole form element including the textbox and google button, so I'd have all the proper namings, then just dropped it onto my form, and bam, instant google search from my local homepage. Did the same with Websters Dictionary and Thesaurus
For your site, I pulled the Form element block out, and stripped out the style class names and some JS crap you didn't need.
Just drop this HTML onto your page wherever you don't already have a Form element defined: (Modify to taste.)
I put Google's search on my own local homepage. I type in my query, click the button, and it sends that to Google, which then gives me a list of the results.
To do this, I loaded Google's homepage (google.com), then went to View Page Source. I did a search for <form and found the form tag for the textbox. I pulled the whole form element including the textbox and google button, so I'd have all the proper namings, then just dropped it onto my form, and bam, instant google search from my local homepage. Did the same with Websters Dictionary and Thesaurus
For your site, I pulled the Form element block out, and stripped out the style class names and some JS crap you didn't need.
Just drop this HTML onto your page wherever you don't already have a Form element defined: (Modify to taste.)
Code: Select all
<form name=\"wordsearch\" style=\"margin: 0pt;\" action=\"http://www.brandbookonline.com/cgi-bin/brand/site.w?location=olc/cobrand-search.w&frames=no&target=main&sponsor=000004&text_qualifier=or&searchtype=word&from=navbar\" method=\"post\">
<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" height=\"27\">
<tr>
<td valign=\"top\"><input name=\"textsearch\" class=\"searchBox\" value=\"bayside\" size=\"28\" type=\"text\"></td>
<td> </td>
<td><input src=\"http://www.brandbookonline.com/brandbooknp/images/arrowbut.gif\" type=\"image\" width=\"20\"></td>
</tr>
</table>
</form>