Forum Moderators: open
*(
if (notes2 == "yes") {
document.write('<fieldset><legend>');
document.write('Notes Area<br></legend>');
document.write('<center>Blurb Text Here that shows up on webpage<br><br><script type="text/javascript" src="http://forms.example.com/form/XX/4#*$!#*$!xx.js"></script><br>More blurb text that shows up after the reg. box</center>');
document.write('</fieldset>');
document.write('<br><br>');
}
)*
This code places the box where it should be in Firebox but in IE 7 the registration box is at the bottom of the table, not between the two text blurbs. Any idea how I can get this to show up in IE?
Thanks!
[edited by: eelixduppy at 5:38 pm (utc) on Feb. 14, 2009]
[edit reason] exemplified [/edit]
If it's "just not rendering" try breaking up the code. Weird things sometimes happen with Javascript within document.write.
document.write('<scr'+'ipt type="text/jav'+'ascr'+'ipt" src="http://forms.example.com/form/XX/4#*$!#*$!xx.js"></scr'+ipt>');
Second, your formatting is likely a result of a combination of Quirks mode and deprecated tags/discouraged approaches to formatting. Use a valid document type [webmasterworld.com] and validate your pages [validator.w3.org], this will make 90% of your formatting problems go away, Javascript or not.
To solve that, here is how I'd handle this (but move inline styles to external style sheets.) You may have to insert text-align:center and width:400px (or some valid value) to get the effects you want:
document.write('<fieldset style="margin:auto;">');
document.write(<legend>'Notes Area<br></legend>');
document.write('<p style="text-align:center">Blurb Text Here that shows up on webpage</p>');
document.write('<div style="margin:auto;">');
document.write('<scr'+'ipt type="text/jav'+'ascr'+'ipt" src="http://forms.example.com/form/XX/4#*$!#*$!xx.js"></scr'+ipt>');
document.write('</div>');
<!--
if you still have problems
add document.write('<div style="clear:both;"></div>');
right here
-->
document.write('<p style="text-align:center">More blurb text that shows up after the reg. box</p>');
document.write('</fieldset>');
Note the clearing div, you probably won't need it, or can set the last p to clear, or overflow: none on the div containing the script - but overall, Standards Mode and semantic output should help you.
<!-- Begin
// NOTE: If you use a ' add a slash before it like this \'
document.write('<TABLE cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td align="center">');
// FLASH CHANGER OPTIONS
var notes1 = "yes" // SHOW 1ST NOTES
var notes2 = "yes" // SHOW 2ND NOTES
var sidewidth = "225" // SIDEBAR WIDTH
var pageheight = "125" // ADD HEIGHT TO ALL PAGES
var phone = "yes" // SHOW PHONE NUMBER
var phoneLR = "left" // phone LEFT OR RIGHT
var phoneX = "5" // phone X LOCATION
var phoneY = "5" // phone Y LOCATION
// 1ST NOTES AREA
if (notes1 == "yes") {
document.write('<fieldset><legend>');
document.write('Notes Area<br></legend>');
document.write('Blurb Text<a href="webpage.htm">Contact us for more info.</a><br>');
document.write('</fieldset>');
document.write('<br><br>');
}
// 2ND NOTES AREA
if (notes2 == "yes") {
document.write('<fieldset><legend>');
document.write('Notes Area<br></legend>');
document.write('<center>Blurb Text<br><br><script type="text/javascript" src="http://example.com/form/xx/4#*$!#*$!xx.js"></script><br>Blurb Text Again</center>');
document.write('</fieldset>');
document.write('<br><br>');
}
// START SIDEBAR MENU //
document.write('<TABLE cellpadding="0" cellspacing="0" border="0"><tr><td>');
document.write('<a href="website.htm" class="menuSidebar">Stuff</a>');
document.write('<a href="website.htm" class="menuSidebar">Stuff</a>');
document.write('<a href="website.htm" class="menuSidebar">Stuff Slideshow</a>');
document.write('</td></tr></table><br>');
// END SIDEBAR MENU //
// START PHONE NUMBER IN TOP MENU
// PAGEHEIGHT AND WIDTH SPACER (EDIT VARIABLES AT THE TOP)
document.write('<IMG SRC="spacer.gif" HEIGHT="'+pageheight+'" WIDTH="'+sidewidth+'" border="0"><br>');
document.write('</td></tr></table>');
// End -->
[edited by: eelixduppy at 5:01 pm (utc) on Feb. 16, 2009]
[edit reason] exemplified [/edit]