Javascript Question
- Started
- Last post
- 17 Responses
- -scarabin-
i want to make a basic form with nothing but one text field, that makes you go to the following url when submitted:
creative.gettyimages.com/source...
where FROG is the value of the text field.
this will allow me to be able to search gettyimages from this new form instead of going to gettyimages' website.
how would you go about coding this?
- UndoUndo0
you mean you want to pull the results of the search back to your site?
in php you can use $searchResult = file_get_contents('your url with vars);
then echo out $searchResult ; where you need it.
:)
- -scarabin-0
actually, php won't do, it's destined for here:
http://scarabin.net/cgi-bin/home…
(the forms are printed html within a cgi script)
- -scarabin-0
thanks though, undo
do you know of a javascript or simply a form solution?
- -scarabin-0
maybe this would work if the action is "http://creative.gettyimages.com...
and the field is "txtSearch"
brb, gonna try it
- Nairn0
Jesus, they've certainly made that convoluted, haven't they?
Sorry dude - I lost interest after 10 minutes of picking away..
- UndoUndo0
not sure about the javascript solution and i havent touched perl in years.
- -scarabin-0
i know, it's insane nairn. i've probably spent three hours trying to isolate their form and pretend i'm searching from their server to no avail
instead i made a form from scratch that submits the same resulting string that comes out of their form
and it works :D
far left column- "getty images"
http://scarabin.net/cgi-bin/home…
- Nairn0
Have you made a blunt page, including all of the js scripts from the /source/ directory?
I'd try that, then whittle out all the extraneous code 'til you're left with what you need...
...'sNot quite as easy as the Dictionary.com search, eh? :)
ps. I like the way you've set your HPage, with the labels being the search fields - very efficient...
- unfittoprint0
make a js formsubmit function.
use it in an onsubmit event
with a false return.
construct your string with your textfield value.
change your location.href with that.
voilá.
- -scarabin-0
thanks, nairn
- ********0
Do you own fswdesign Undo?
- -scarabin-0
god, i keep telling myself i'm gonna quit doing web, but sorting out code fills some morbid void for me
- UndoUndo0
no. i'm a humble employee.
- ********0
let me know when i can have a job huh? my php is getting better and better.... haha.
- UndoUndo0
the stuff i have seen looks really good dude.
its grim up north ya know :)
- ********0
it's grim down here today...
- UndoUndo0
chin up mate, can't be that bad the weekends only a day away!
:)