Place Text in Page you Link to

For system help, all hardware / software topics NOTE: use Coders Corner for all coders topics.

Moderators: Krom, Grendel

Post Reply
User avatar
Spidey
DBB Grand Master
DBB Grand Master
Posts: 10724
Joined: Thu Jun 28, 2001 2:01 am
Location: Earth

Place Text in Page you Link to

Post by Spidey »

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…
User avatar
Krom
DBB Database Master
DBB Database Master
Posts: 16043
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:

Post by Krom »

Can you show what it is exactly that he wants to link to? If just linking to the URL doesn't work then most likely what he needs is a simple hard coded form input, but I can't be sure without knowing what he wants to link to.
User avatar
Spidey
DBB Grand Master
DBB Grand Master
Posts: 10724
Joined: Thu Jun 28, 2001 2:01 am
Location: Earth

Post by Spidey »

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.
User avatar
Krom
DBB Database Master
DBB Database Master
Posts: 16043
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:

Post by Krom »

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?
User avatar
Spidey
DBB Grand Master
DBB Grand Master
Posts: 10724
Joined: Thu Jun 28, 2001 2:01 am
Location: Earth

Post by Spidey »

I don’t see why that link wouldn’t work for him, unless he wanted to narrow it down further, he did say something about only the “Made in America” items. (I was keeping it simple for the time being)

Thanks, I’m going to ask him as soon as I can…
User avatar
Jeff250
DBB Master
DBB Master
Posts: 6514
Joined: Sun Sep 05, 1999 2:01 am
Location: ❄️❄️❄️

Post by Jeff250 »

Krom wrote:(and it would likely annoy any number of security settings and programs)
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.
User avatar
Spidey
DBB Grand Master
DBB Grand Master
Posts: 10724
Joined: Thu Jun 28, 2001 2:01 am
Location: Earth

Post by Spidey »

Not what I had in mind Jeff, I just wanted to script something you could do with your mouse & keyboard anywayz…
User avatar
Testiculese
DBB Material Defender
DBB Material Defender
Posts: 4688
Joined: Sun Nov 11, 2001 3:01 am

Post by Testiculese »

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.)

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>&nbsp;&nbsp;</td>
<td><input src=\"http://www.brandbookonline.com/brandbooknp/images/arrowbut.gif\" type=\"image\" width=\"20\"></td>
</tr>
</table>
</form>
User avatar
Spidey
DBB Grand Master
DBB Grand Master
Posts: 10724
Joined: Thu Jun 28, 2001 2:01 am
Location: Earth

Post by Spidey »

That’s pretty useful thanks!
Post Reply