Cactiveform Internet Explorer "object Doesn't Suport This Property Or Method"

Hello:

I’m creating a vey simple form and in Internet Explorer 8 I’m getting the “Object Doesn’t Support This Property Or Method”. Can anyone see why this is happening? Here’s the line in the debugger that its failing on:




jQuery(function($) {

jQuery('#login-form').yiiactiveform({'validateOnSubmit':true,'attributes':[{'id':'LoginForm_username','inputID':'LoginForm_username','errorID':'LoginForm_username_em_','model':'LoginForm','name':'username','enableAjaxValidation':false,'clientValidation':function(value, messages, attribute) {


if(jQuery.trim(value)=='') {

	messages.push("Username cannot be blank.");

}


}},{'id':'LoginForm_password','inputID':'LoginForm_password','errorID':'LoginForm_password_em_','model':'LoginForm','name':'password','enableAjaxValidation':false,'clientValidation':function(value, messages, attribute) {


if(jQuery.trim(value)=='') {

	messages.push("Password cannot be blank.");

}


}},{'id':'LoginForm_rememberMe','inputID':'LoginForm_rememberMe','errorID':'LoginForm_rememberMe_em_','model':'LoginForm','name':'rememberMe','enableAjaxValidation':false,'clientValidation':function(value, messages, attribute) {


if(jQuery.trim(value)!='' && value!="1" && value!="0") {

	messages.push("Remember me next time must be either 1 or 0.");

}


}}]});

});




j

And here’s the code I’m using to create the form:





<?php

/* @var $this SiteController */

/* @var $model LoginForm */

/* @var $form CActiveForm  */


?>


<link href="<?php echo Yii::app()->baseUrl; ?>/css/style.css" rel="stylesheet" type="text/css" />

<!--SCRIPTS-->

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>


<!--WRAPPER-->

<div id="wrapper">


	<!--SLIDE-IN ICONS-->

    <div class="user-icon"></div>

    <div class="pass-icon"></div> 

    <!--END SLIDE-IN ICONS-->


<!--LOGIN FORM-->

	<?php $form=$this->beginWidget('CActiveForm', array(

		'id'=>'login-form',

		'enableClientValidation'=>true,

		'clientOptions'=>array(

			'validateOnSubmit'=>true),

		'htmlOptions'=>array('class'=>'login-form')

	)); ?>

	

	<div class="header">

    <img src='<?php echo Yii::app()->baseUrl;?>/images/pe_logo.png'/>

    <!--DESCRIPTION--><span></span><!--END DESCRIPTION-->

    </div>

    <!--END HEADER-->


	<div class="content">


		<?php echo $form->textField($model,'username',array('id'=>'username',

					  'class'=>'input username',

					  'placeholder'=>'Username')); ?>					  

		<b><?php echo $form->error($model,'username'); ?></b>


		<?php echo $form->passwordField($model,'password',array('id'=>'password',

					  'class'=>'input password',

					  'placeholder'=>'Password')); ?>

		<b><?php echo $form->error($model,'password'); ?></b>

	</div>

		

	<div class="footer">

		<?php echo CHtml::submitButton('Login',array('class'=>'button','name'=>'login'));?>

		<?php echo CHtml::button('Register',array('class'=>'register','name'=>'register'));?> 		

	</div>


	<?php $this->endWidget('login-form'); ?>


</div>



Thanks so much!

Hello!

Could you please post the html code of whole HTML page?

Yeah, I agree with Doojin for checking the HTML output.

Probably 2 instances of jQqeury are loaded: one from the google cdn, and the other from the Yii core.

Thanks guys. I’ll post it when I get a few minutes but what actually fixed it (still not sure why) is I removed the options in the form so that now it looks like this:




<?php $form=$this->beginWidget('CActiveForm', array(

		'id'=>'login-form',		

		'htmlOptions'=>array('class'=>'login-form')

)); ?>



And now everything works fine.