Strange Validation Behaviour

Hi,

I need help, I have a dropdown that selects a value which is then validated and stored in the database. This all works fine on localhost on my Windows PC running XAMPP but when I upload it to the live server the same value does not validate and the attribute is missing from the array completely, and the dropdown resets.

Does anyone have any ideas why this could be? I’ve tried changing rules etc but the same thing happens only on localhost does the dropdown behave correctly.

I have also tried changing the input type to just a text box but the same thing happens, it only validates on localhost.

Thanks

Plz show the code for your form field and validation rule.


public function rules()

	{

		// NOTE: you should only define rules for those attributes that

		// will receive user inputs.

		return array(

			array('firstname, lastname, password, email, referrer_id, referral_type, can_refer, telephone, emailConfirmation, passwordConfirmation, acceptedTerms, company_id', 'required', 'on' => 'register'),

			array('firstname, lastname, email, telephone', 'required', 'on' => 'user'),

			array('status, referrer_id, referral_type, company_id, can_refer, address_id', 'numerical', 'integerOnly' => true),

			array('firstname, occupation, lastname, password, email, telephone, ip_address', 'length', 'max' => 255),

			array('last_login','safe'),

			array('email', 'email'),

			array('email', 'unique'),

			array('telephone', 'telephoneValidation'),

			array('password, passwordConfirmation', 'length', 'min' => 6),

			array('passwordConfirmation', 'compare', 'compareAttribute' => 'password', 'on' => 'register'),

			array('emailConfirmation', 'compare', 'compareAttribute' => 'email', 'on' => 'register'),

			array('acceptedTerms', 'acceptedTerms', 'on' => 'register'),

			array('email', 'userExists', 'on' => 'register'),

			// The following rule is used by search().

			// Please remove those attributes that should not be searched.

			array('referral_type, id, occupation, firstname, lastname, password, email, status, telephone, mobile, created_at, modified_at, referrer_id, company_id, ip_address, last_login, can_refer, address_id', 'safe', 'on' => 'search'),

		);

	}


<?php echo $form->labelEx($u, 'company_id'); ?>

				<?php echo $form->dropDownList($u, 'company_id', $companylistData, array("empty" => "Your Employer?")) ?>

									<?php echo $form->error($u, 'company_id') ?>

Seems ok.

The only idea that I have right now is schema caching.

Check the config file and see if you have schema caching turned on. If so, turn it off and try to store the record once again.