Well been reading here for about an hour and have read all over the web for 5 hours. And I just cannot find anywhere it is throughly adressed.
IE
document.getElementById(calformsid).submit();
works
FireFox
document.forms[calformsid].submit();
works
Sarfari
none of the above works plus I tried:
document.calformsid.submit();
window.document.calformsid.submit();
window.document.getElementById(calformsid).submit();
window.document.forms[calformsid].submit();
eval('document.' + calformsid + '.submit()');
eval('document.forms[' + calformsid + '].submit()');
eval('document.getElementById(' + calformsid + ').submit()');
eval('window.document.' + calformsid + '.submit()');
eval('window.document.forms[' + calformsid + '].submit()');
eval('window.document.getElementById(' + calformsid + ').submit()');
I know some of that is technically the same as some of the others listed but was just trying to make sure all these anti W3C standards browsers weren't trying to pull a fast one on me.
I saw one suggestion (while reading around) that the "s" in the submit may need to be caitalized in some browsers. Haven't tested that yet as I am hoping for some clearer direction.
To give you a better picture of what I am doing. I am having an onclick event submit a form with a hidden field so as to pass a date to the next page for the user to submit some additional data related to the date. The date is selected from a php generated calendar that has perdefined days that the user can access. As the calendar is so small a subimt button is impractical (and down right ugly). As well the date numerals are just readable and I would not pass such a curse on someone as to make them try and click a "1" so the onclick occurs in the <td> tag.
The onclick calls a javascript function and passes a dynamic form name that has a prefix with a compiled date to conicide with the date on the calendar.
$clickdetails = "onclick=\"GetSignupPage('F". $styledate ."')\" ";
'F". $styledate ."' == 'F20080619'
function GetSignupPage(calformsid) {
document.forms[calformsid].submit();
}
calformsid == 'F20080619'
So does anyone know how to get the submit to work in safari as well as some of the other major browsers that I haven't tested yet. A link to an exaustive discussion on making the submit cross browser compatible will do as well.
I know some of you may want all my code and if so be warned it is lengthy do to the amount of functionallity that is needed. But I think the answer should be the same irrelevant of my related code.
As well if there is beter way I am all ears.