This topic is locked

Add Button To Redirect To A Url

1/31/2013 7:33:20 AM
PHPRunner General questions
B
bluepoint author

Confused about this post:

http://www.asprunner.com/forums/topic/18466-button-to-call-another-script-outside-phprunner/
Trying to add a simple button to redirect to an outside URL. My code:
Client side before:

location.href = 'www.cnn.com''>www.cnn.com';;
Server side:

header("Location: http://www.cnn.com";);
Client side after:

location.href = 'www.cnn.com''>www.cnn.com';;
Nothing works: It just redirects to my homepage.
Whats the secret?

C
cgphp 1/31/2013

Remove any code from the "Server" tab and from the "Client after" tab. Only in the "Client before" tab, enter the following code:

ctrl.setEnabled();

location.href = 'http://www.cnn.com';;
B
bluepoint author 1/31/2013

ok ctrl.setEnabled was the secret....not sure why this is not in the example...
Thanks....



Remove any code from the "Server" tab and from the "Client after" tab. Only in the "Client before" tab, enter the following code:

ctrl.setEnabled();

location.href = 'http://www.cnn.com';;


Sergey Kornilov admin 1/31/2013

ctrl.setEnabled(); doesn't have anything to do with it. The secret is to specify URL properly (http:// in front) and to remove the server side code.

C
cgphp 1/31/2013

I have added the ctrl statement in the case you will return false for any reason in the "Client before" tab.