I have 2 fields, x and y. If both the fields are same then I want to check save the changes, or else I want to give a message "Value mismatched. Unable to save changes".
system.xml
<test1 translate="label">
<label>test1</label>
<frontend_type>text</frontend_type>
<sort_order>1</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</test1>
<test2 translate="label">
<backend_model>test/system_config_backend_test2</backend_model>
<label>test2</label>
<frontend_type>text</frontend_type>
<sort_order>2</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</test2>
Backend model class
public function save()
{
$test2= $this->getValue(); //get the value from our config
//need to get $test1 also. How to get??
$test1 = ;
if($test1 != $test2)
{
Mage::throwException('Could not saved');
}
return parent::save();
}
How to get the two values together so that we can compare and check? Thanks in advance!