Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Redirect and do a return?
Old 05-12-2010, 03:07 PM Redirect and do a return?
Experienced Talker

Posts: 47
Trades: 0
Hi there,
I need to make the browser redirect then do return test(form) but i dont know how to do this.

Can someone explain how to do this for me?

Thanks.
NextToNothing is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-12-2010, 03:16 PM Re: Redirect and do a return?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,383
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
you can't "redirect then return" with javascript once redirected you lose any control over the browser.

OR

is it that you want to return to a page after processing a form (and you can't do the with javascript either.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?

Last edited by chrishirst; 05-12-2010 at 03:34 PM.. Reason: edited my rubbish typnig
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 05-12-2010, 03:23 PM Re: Redirect and do a return?
Experienced Talker

Posts: 47
Trades: 0
Quote:
Originally Posted by chrishirst View Post
you can't "redirect then return" with javascript once redirected you loose any control over the browser.

OR

is it that you want to return to a page after processing a form (and you can't do the with javascript either.
I want the browser to be redirected to a page and then do return test(form) because the page it is redirecting to has the same form on as the page it has been redirected from when you click the button.

Get what im saying?

If i cant do this by javascript how could i do this.
NextToNothing is offline
Reply With Quote
View Public Profile
 
Old 05-12-2010, 03:39 PM Re: Redirect and do a return?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,383
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Quote:
Get what im saying?
No!

you want to go from a form to exactly the same form on a different page?? Why?
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 05-13-2010, 02:04 PM Re: Redirect and do a return?
Experienced Talker

Posts: 47
Trades: 0
Quote:
Originally Posted by chrishirst View Post
No!

you want to go from a form to exactly the same form on a different page?? Why?
The homepage for my site has a form on it. There is also a from on another page. I want it to display the results from the form on the homepage to be displayed on the other page, not the homepage.

The form is values entered incorrect displays an error message in a div. This is done by Javascript. I dont want the errors to be displayed on the homepage instead on the other page which will display the results.

Last edited by NextToNothing; 05-13-2010 at 02:09 PM..
NextToNothing is offline
Reply With Quote
View Public Profile
 
Old 05-13-2010, 02:07 PM Re: Redirect and do a return?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,383
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
So not redirecting then, just passing form results. So what server side code do you have available?
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 05-13-2010, 02:57 PM Re: Redirect and do a return?
Experienced Talker

Posts: 47
Trades: 0
Ok.
My javascript code is:
Code:
	function Test(form)
	   {
		if ( !Test(form) )
		return false;
		return true;
	   }
	function Test(form)
	   {
		str = document.Form1.dom.value;
		if ( str == "" )
		   {
			document.getElementById('error').innerHTML = "\\nThe text field is blank.\\n\\n";
			document.Form1.dom.focus();
			return false;
		   }
		for ( var i = 0; i < str.length; i++ )
		   {
			var ch = str.substring(i, i + 1);
			if (((ch < "a" || "z" < ch) && (ch < "A" || "Z" < ch) && (ch < "0" || "9" < ch)) && ch != '-')
			   {
				document.getElementById('error').innerHTML = "The text feild has illegal characters! Use only letters and numbers or a '-'";
				form.dom.value = "";
				document.Form1.dom.focus();
				return false;
			   }
		   }
		return true;
	   }
Need anything else to help me?
NextToNothing is offline
Reply With Quote
View Public Profile
 
Old 05-13-2010, 03:06 PM Re: Redirect and do a return?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,383
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
server side code NOT client side.

Your receiving page has to process and display the values.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to Redirect and do a return?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.29095 seconds with 12 queries