...

View Full Version : Form1.submit() works in Mozilla but not in Internet Explorer



jonka589
01-29-2005, 08:13 PM
Hi!
I am trying to figure out why this works in Mozilla but not in IE. I have used OverLIB (http://www.bosrup.com/web/overlib/) to generate a calender. This allows the users to click on a date and the scipt will return the date into a textfield in a form. This works fine, but it's not really want I want. After the user has selected a date, I want to post the form to a server. This works fine in Mozilla but not in IE6. What can I do to make it work in IE6? Thanks in advance :)

Regards Jonas Karlsson, Sweden.

Here's the code that works in FireFox but not in IE6:

alendar.prototype.show = function() {
var vCode = "";

// build content into global var ggWinContent
ggWinContent += ("<FONT FACE='" + fontface + "' ><B>");
ggWinContent += (this.gMonthName + " " + this.gYear);
ggWinContent += "</B><BR>";

// Show navigation buttons
var prevMMYYYY = Calendar.calc_month_year(this.gMonth, this.gYear, -1);
var prevMM = prevMMYYYY[0];
var prevYYYY = prevMMYYYY[1];

var nextMMYYYY = Calendar.calc_month_year(this.gMonth, this.gYear, 1);
var nextMM = nextMMYYYY[0];
var nextYYYY = nextMMYYYY[1];

ggWinContent += ("<TABLE WIDTH='100%' BORDER=1 CELLSPACING=0 CELLPADDING=0 BGCOLOR='#e0e0e0' style='font-size:" + fontsize + "pt;'><TR><TD ALIGN=center>");
ggWinContent += ("[<A HREF=\"javascript:void(0);\" " +
"onMouseOver=\"window.status='Go back one year'; return true;\" " +
"onMouseOut=\"window.status=''; return true;\" " +
"onClick=\"Build(" +
"'" + this.gReturnItem + "', '" + this.gMonth + "', '" + (parseInt(this.gYear)-1) + "', '" + this.gFormat + "'" +
");" +
"\"><<Year<\/A>]</TD><TD ALIGN=center>");

ggWinContent += ("[<A HREF=\"javascript:void(0);\" " +
"onMouseOver=\"window.status='Go back one month'; return true;\" " +
"onMouseOut=\"window.status=''; return true;\" " +
"onClick=\"Build(" +
"'" + this.gReturnItem + "', '" + prevMM + "', '" + prevYYYY + "', '" + this.gFormat + "'" +
");" +
"\"><Mon<\/A>]</TD><TD ALIGN=center>");
ggWinContent += " </TD><TD ALIGN=center>";
ggWinContent += ("[<A HREF=\"javascript:void(0);\" " +
"onMouseOver=\"window.status='Go forward one month'; return true;\" " +
"onMouseOut=\"window.status=''; return true;\" " +
"onClick=\"Build(" +
"'" + this.gReturnItem + "', '" + nextMM + "', '" + nextYYYY + "', '" + this.gFormat + "'" +
");" +
"\">Mån><\/A>]</TD><TD ALIGN=center>");
ggWinContent += ("[<A HREF=\"javascript:void(0);\" " +
"onMouseOver=\"window.status='Go forward one year'; return true;\" " +
"onMouseOut=\"window.status=''; return true;\" " +
"onClick=\"Build(" +
"'" + this.gReturnItem + "', '" + this.gMonth + "', '" + (parseInt(this.gYear)+1) + "', '" + this.gFormat + "'" +
//Here's the problem!
"); form1.submit();" +
"\">Year>><\/A>]</TD></TR></TABLE><BR>");

// Get the complete calendar code for the month, and add it to the
// content var
vCode = this.getMonthlyCalendarCode();
ggWinContent += vCode;

}

grog
01-29-2005, 10:11 PM
I'm not sure if this will help but try using document.form1.submit(); instead of just form1.submit();

jonka589
01-30-2005, 11:10 AM
Thanks for the advice, however I have already tried that and it won't crack the case. ;)

Regards

Jonas Karlsson, Sweden

dmc
01-30-2005, 01:36 PM
document.forms[0].submit() is another option.

Is it showing an error in IE6 or does it nothing.
If ie coulnd't find the form it would raise an error.

Can you give the complete source with the form.

liorean
01-30-2005, 02:57 PM
Do you have this online somewhere? Preferably with everything that is not relevant for the bug removed?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum