/    Sign up×
Community /Pin to ProfileBookmark

Very Simple Pop-Up Function Won’t Work in IE

I made a 50th anniversary guest book to add memories/etc about our organization. The people can look at the entries and then if they want to add one of their own, there’s a link that should pop up a form in a new for them to add it. [B]I have no idea why this pop is not working in Internet Explorer (both IE6 and 7). It works beautifully in Firefox.[/B] I’ve made pop up functions before with no problems and have checked it a million times for stupid syntax errors. How you can go wrong with window.open? I’m stuck.?

Again, [I]only the actual pop up function doesn’t work.[/I] All the other javascript seems to be working fine in IE. I included the javascript for the tab navigation too because the link to the pop up form changes based on what tab they are in (i.e. if they’re looking at the past memories tab and click on the link, it takes them to the past memories form). I know it’s probably TMI on the code, but I thought it might be somehow related since I pass variables around like a football. I thought maybe it was corrupting the script somewhere else down the line and then ruining the pop-up command?

[B]HTML Page[/B]

[CODE]<html>
<head>
<title>50th Anniversary Reflections</title>
<script type=”text/javascript” src=”js/guestbook.js”></script>
<link href=”css/guestbook.css” media=”all” type=”text/css” rel=”stylesheet”>
</head>

<body>
<div id=”guestbook_container”>

<div id=”tab_nav_container”>
<ul>
<li><div id=”tab_1″ class=”tabs_on” onclick=”tabsClass.switchTab(this);”><a target=”gstbk_frame” href=”guestbook_query.asp?cat=1″ onclick=”change_value(1);”>Past Memories</a></div></li>
<li><div id=”tab_2″ class=”tabs_off” onclick=”tabsClass.switchTab(this);”><a target=”gstbk_frame” href=”guestbook_query.asp?cat=2″ onclick=”change_value(2);”>Career Impact</a></div></li>
<li><div id=”tab_3″ class=”tabs_off” onclick=”tabsClass.switchTab(this);”><a target=”gstbk_frame” href=”guestbook_query.asp?cat=3″ onclick=”change_value(3);”>Future Wishes</a></div></li>
<li><div id=”new” class=”tabs_off” onclick=”popupform();”>Share Your Memories</div></li>
</ul>
</div><!– end tab_nav_container –>

<div id=”tab_content_container”>
<div id=”tab_1_data” class=”tab_content”><p class=”tab_category”>What is your most important memory of NACUA?</p></div>
<div id=”tab_2_data” class=”tab_content” style=”display: none;”><p class=”tab_category”>How has NACUA benefitted you and your career?</p></div>
<div id=”tab_3_data” class=”tab_content” style=”display: none;”><p class=”tab_category”>What is your most important wish or hope for NACUA’s future?</p></div>
</div><!– end tab_content_container –>

<script type=”text/javascript”>
tabsClass.addTabs(“tab_nav_container”);
</script>
<br class=”clear” />

<div id=”iframe_container”>
<iframe name=”gstbk_frame” id=”gstbk_frame” src=”guestbook_query.asp?cat=1″ width=”730px” height=”550px” scrolling=”auto” frameborder=”none”></iframe>
</div><!– end iframe_container –>
<br class=”clear” />

</div><!– end guestbook_container –>
</body>
</html>[/CODE]

[B]Guestbook.js File[/B]

[CODE]//***** ASSIGN/CHANGE CATEGORY VALUES *****

function popupform(){
var href;
href=”guestbook_submission_form.asp?cat=”+catValue;
window.open(href, “Submission Form”, ‘width=600, height=400, scrollbars=no’);
}

var catValue = “1”

function change_value(catChange){
catValue=catChange;
change_text();
}

function change_text(){
if(catValue==”1″){
document.getElementById(“new”).innerHTML = “<a href=’#’ style=’color:#ffffff;’>Share Your Memories!</a>”;
}
if(catValue==”2″){
document.getElementById(“new”).innerHTML = “<a href=’#’ style=’color:#ffffff;’>Share Your Career Experiences!</a>”;
}
if(catValue==”3″){
document.getElementById(“new”).innerHTML = “<a href=’#’ style=’color:#ffffff;’>Add Your Own Wish!</a>”;
}
}

//***** ASSIGN/CHANGE VALUES AND TABS *****

function assignCategory(cat){
document.form.category.value=cat;
}

function onLoadAssignAndSwitch(cat){
assignCategory(cat);
tabsClass.addTabs(“tab_nav_container”);
var initialTab = “tab_” + cat + “_data”
if (initialTab != “tab_1_data”){
document.getElementById(initialTab).style.display = “”;
document.getElementById(“tab_1_data”).style.display = “none”;
}
document.getElementById(“tab_” + cat).className = “tabs_on”;
}

function assignAndSwitch(element, cat){
tabsClass.switchTab(element);
assignCategory(cat);
}

//***** TABBED MENU *****

var tabsClass = {
tabSetArray: new Array(),
classOn: “tabs_on”,
classOff: “tabs_off”,

addTabs: function (tabsContainer) {
tabs = document.getElementById(tabsContainer).getElementsByTagName(“div”);
for (x in tabs) {
if (typeof(tabs[x].id) != “undefined”) {
this.tabSetArray.push(tabs[x].id);
} else {}
}
},

switchTab: function (element) {
for (x in this.tabSetArray) {
tabItem = this.tabSetArray[x];
dataElement = document.getElementById(tabItem + “_data”);
if (dataElement) {
if (dataElement.style.display != “none”) {
dataElement.style.display = “none”;
} else {}
} else {}

tabElement = document.getElementById(tabItem);
if (tabElement) {
if (tabElement.className != this.classOff) {
tabElement.className = this.classOff;
} else {}
} else {}
}

document.getElementById(element.id + “_data”).style.display = “”;
element.className = this.classOn;
}
};[/CODE]

I’m not too advanced in javascript but not a total idiot, just a designer trying to make a nice website. Any help and/or suggestions would be greatly appreciated! Thank you!

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@skywalker2208Dec 16.2009 — I think IE doesn't like the second parameter of window.open to have a space.
[code=php]
window.open(href, "Submission Form", 'width=600, height=400, scrollbars=no');
[/code]


change to
[code=php]
window.open(href, "Submission_Form", 'width=600, height=400, scrollbars=no');
[/code]


I think I came across this before.
Copy linkTweet thisAlerts:
@visualanticsauthorDec 17.2009 — ... and that was it. Should have known it was something that stupid.

THANK YOU!!!!
×

Success!

Help @visualantics spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...