This is a discussion on "Display results of a submit form (getting url) in same window??" within the JavaScript Forum section. This forum, and the thread "Display results of a submit form (getting url) in same window?? are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
Display results of a submit form (getting url) in same window??
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
Hey hey!
Riiiight, I would like that when the user hits the submit button, that the results are displayed in a box in the same window, underneath the search form =D I have no idea if this is possible.. but an example script or such would be awsome =D Im guessing that the submit button would be edited where 'target=_blank' is? Extreme thankyouness in advanced =D |
|
|
|
#2
|
||||
|
||||
|
Re: Display results of a submit form (getting url) in same window??
I dont know anything about JS or Ajax but i think this may have to be achieved using Ajax.
Could this: http://www.captain.at/howto-ajax-form-post-request.php be what you are looking for?
__________________
Marc Staff Manager - Webforumz.com Want to be a moderator? PM me. |
|
#3
|
|||
|
|||
|
Re: Display results of a submit form (getting url) in same window??
thanks for the reply!
Well... simular...just not so complicated...ajax is where i got the idea from =D and iv seen it done in js. I have researched a little, and as i said above, i THINK it the post=_blank (or w/e) i have to edit... like post=frame ... bla bla pxls. Thank you again for the reply though. |
|
#4
|
|||
|
|||
|
Re: Display results of a submit form (getting url) in same window??
It is very good to help you with your problem with a completely crypted source code... ^_-
|
|
#5
|
|||
|
|||
|
Re: Display results of a submit form (getting url) in same window??
ok i made a link with the decrypted code
Last edited by jahphill; Nov 8th, 2007 at 21:19. |
|
#6
|
|||
|
|||
|
Re: Display results of a submit form (getting url) in same window??
Ok, you should eliminate the "target='_blank'" that will always open a new page. Replace it with OnSubmit=\"return getresults();\"
At the place where the results should be displayed, add a div with "<div id='resultdiv'></div>" Then, take this AJAX Javascript from me (I have prepared it for a little ajax tutorial, so there are many comments) and add it to your page in the head.
When there is no Javascript activated, it will continue loading a second page! |
|
#7
|
|||
|
|||
|
Re: Display results of a submit form (getting url) in same window??
Hey hey!!
Thanks so much for that reply =D I have updated it, however it does not work for me, i have probably done a foolish mistake =[ but im not sure what =D Could you have a peak in my source? =D |
|
#8
|
||||
|
||||
|
Re: Display results of a submit form (getting url) in same window??
For starters this line
document.tehmonkey.search.focus(); is incorrect, there is no form element named 'search', from looking at your source, it should be document.tehmonkey.searchTerm.focus(); also OnSubmit=\"return getresults();\" should just be OnSubmit="return getresults();" Fix these first as I think this is having a flow-on effect for the rest of the script
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
|
#9
|
|||
|
|||
|
Re: Display results of a submit form (getting url) in same window??
Okie, updated that.. still no result =D =[ infact the search button does not work at all now =[
|
|
#10
|
||||
|
||||
|
Re: Display results of a submit form (getting url) in same window??
Move
var http_request = false; // reset the request to the top of the script before function getresults()
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
|
#11
|
|||
|
|||
|
Re: Display results of a submit form (getting url) in same window??
Hmm..
Yet another error occured, it says 'There was an error, try again later' I have just read through some information about copyright and content etc. finding that i would be braking the law displaying other websites within my website =S (this does not apply for google, but for other websites which the form searched) =[ which sucks... The reason i created it was for a legal alternative to programs loaded with spyware, viruses, and rubish like that. ...well it is not legal, but the website was made to give indirect links, using google. Thank you for all your help, but my decision is to stay on the right side of the law =D Thanks for the ajax script, good luck with your tutorial! Rakuli - > see ya around on your site =D |
|
#12
|
|||
|
|||
|
Re: Display results of a submit form (getting url) in same window??
hey =D
a little embarrassing but i'd like to continue this project =D Id just like to change it a little: That this function is only used when the target site is google, where it only displays the results. Possible? =D >*huge blush*< |
|
#13
|
|||
|
|||
|
Re: Display results of a submit form (getting url) in same window??
id like to rudely bump tis thread =[
link update :
|
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Submit options and open results in a new window | xshane | JavaScript Forum | 2 | May 21st, 2008 10:23 |
| Submit a form in popup to the parent window | hassan1365 | JavaScript Forum | 2 | Jan 25th, 2008 08:34 |
| submit many forms - auto submit the same form many times | divs | JavaScript Forum | 0 | May 24th, 2007 10:10 |
| Submit form results to file/folder | cat101 | PHP Forum | 9 | Nov 10th, 2006 12:00 |