Solved

DotNetNuke Text\HTML Javascript Redirect

Posted on 2010-08-31
7
1,078 Views
Last Modified: 2012-05-10
Hello,
I am sure this is a very stupid question, but I am rather new to web coding.
I am trying to make a simple little form in DotNetNuke with a Text\HTML module that will allow me to have a couple text entry boxes, and append those as querystring variables to a javascript redirect button. When I try do this with window.location.replace('URL') in my onclick, it just refreshes back to the same page (not the page I want to redirect to). when I use window.open('url') that works, but it goes to a new window.
What am I doing wrong?
0
Comment
Question by:markterry
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
7 Comments
 
LVL 6

Expert Comment

by:thaytu888888
ID: 33574082
- Try window.location = yourURL;
0
 
LVL 1

Expert Comment

by:talktodhand
ID: 33574123
function redirect()
    {
        location.href = "newURL";
    }
0
 
LVL 6

Author Comment

by:markterry
ID: 33574208
Neither work, also alert("Hello World!"); does work. I am starting to think there is something in the CMS stopping this code.
also thatyu888888, I thought windows.location causes a loop when people use the back button.
0
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 
LVL 6

Author Comment

by:markterry
ID: 33574260
okay, new news... window.location.redirect works in IE, but not Chrome or FireFox. So kinda good, but obviuosly I would want it to work in all browsers.
0
 
LVL 1

Accepted Solution

by:
talktodhand earned 500 total points
ID: 33574306
Hi,

works on IE,Chrome and FireFox too....
I have tried following code:

<html>
<head>
<script>
function redirect()
{
      window.location.href="http://www.google.com";
}
</script>
</head>
<body>
<input type=button onclick=redirect();>
</body>
</html>

Hope it will help.
0
 
LVL 6

Author Comment

by:markterry
ID: 33582582
that indeed does the trick talktohand. adding the window before location.href seems to be working.
0
 
LVL 6

Author Closing Comment

by:markterry
ID: 33582590
Thank you for your help.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Conformation code 4 37
Run software updates from the website 6 50
Submit button if clicked twice submits twice 1 24
Error just appeared 3 23
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question