Forums

Required fields error in IE8

highrockmedia 18 Jun, 2009
I have some required fields on my forms that in all other browsers say "This field is required" if the fields in question are not filled and the submit button is clicked.

However, in IE 8, I am apparently getting raw javascript on the page if a field is not filled in.

Here is what is being echoed on the page:

function(){var tag=this.getTag();if(['style','script'].contains(tag)){if(window.ie){if(tag=='style')return this.styleSheet.cssText;else if(tag=='script')return this.getProperty('text');}else{return this.innerHTML;}}
return($pick(this.innerText,this.textContent));}


I am on 3.1 RC5 with Joomla 1.5.10

Any ideas?
highrockmedia 19 Jun, 2009
I believe I have found a work around for this as mentioned on this page:

http://www.chronoengine.com/forums/index.php?option=com_chronoforums&cont=posts&f=6&t=14165&start=15

Mid way down the page, it mentions this:

In IE8 mode the correct error message is displayed when title="" is present, but when it is not present a JS code snippet is shown


So I put title="" in my form tags and the problem goes away. I can't recall if this is a valid tag that can be used with form code but it solves the problem.
GreyHead 19 Jun, 2009
Hi highrockmedia,

The more recent thread here has this fix and another one that may be easier to implement.

Bob
highrockmedia 19 Jun, 2009
Thanks Bob!

I am curious does the emulation code work at the template level?

<?php
$doc =& JFactory::getDocument();
$doc->setMetaData('X-UA-Compatible', 'IE=EmulateIE7', true);
?>
GreyHead 19 Jun, 2009
Hi highrock media,

It should work on any page where the code is executed. I guess with a template you could just as easily add the corresponding meta tag directly. But it does have to be in the first block of tags in the page <head>.

If you use it just on the pages where there is a problem then any other pages can be rerndered in IE8's full glory!

Bob
This topic is locked and no more replies can be posted.