navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
FrontPage Alternative
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

 

Thoughts on js redirect upon hitting Enter

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> General Web Development >> Thoughts on js redirect upon hitting Enter
Page: [1]
 
yb2

 

Posts: 653
Joined: 1/30/2006
Status: offline

 
Thoughts on js redirect upon hitting Enter - 4/5/2006 10:34:57   
I've got a text search field that I want to submit on Enter/Return. Problem is, I want the contents of the field to be a querystring so that the results of the search can be bookmarked. I want to keep the form submission as a POST and not a GET (no budging on that).

I'm thinking about using javascript to check for the Enter key press, and then building the string and redirecting to the results page (same as the search page) so that I get the querystring and the results.

Any thoughts on how I might do this better or why I shouldn't do this will be gratefully received. I've got most of the js written, so it's more of an ideas thing - unless you suggest something I've no idea about! :)
rdouglass

 

Posts: 9280
From: Biddeford, ME USA
Status: offline

 
RE: Thoughts on js redirect upon hitting Enter - 4/5/2006 11:15:34   
quote:

I want the contents of the field to be a querystring


I guess I'm not sure what you're trying to do.

Are you trying to change the ACTION value of the form before you submit? That's pretty straight forward to add virtually any querystring you want onto the ACTION value:

<script language="JavaScript" type="text/JavaScript">
<!--

function submitToFinal() {
document.myform.action = 'mypage.asp?myname=myvalue';
document.myform.submit();
}
//-->
</script>

Is that what you're trying to do?


_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to yb2)
yb2

 

Posts: 653
Joined: 1/30/2006
Status: offline

 
RE: Thoughts on js redirect upon hitting Enter - 4/5/2006 11:31:12   
Not really. I'm using .Net which doesn't really pay much attention to Action, there is no Action since everything is a postback to the same page. Everything is POST too, so GET isn't a possibility. Technically, I'm ignoring the usual .Net model so I can get the querystrings in the address bar to use as bookmark fodder. Perhaps there's a better way with .Net, but I don't know it and can't find it.

I suppose I'm changing the Enter press into a hyperlink click, and the searchterm gets added to the end of the link, then because it isn't really a link I need to do a redirect.

(in reply to rdouglass)
Page:   [1]

All Forums >> Web Development >> General Web Development >> Thoughts on js redirect upon hitting Enter
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts