[eluser]mindprojects[/eluser]
All right guys,i'm not pretty sure,but using the new form validation functions(eg. set_select)something changed from previous version(1.6.3) and i'm not sure if it's a small bug.
What i was doing to repopulate from select boxes in 1.7,while using pagination was :
1) set form data in POST values(eg $_POST['select name'] = selected value
2) set $this->validation->set_select('form_name','option value') into the select element;
This trick was working till 1.6.3 release,as it should be,but bothing to do with the new 1.7 set_select.
Then i discovered the problem:
This is the code from form_helper
Code:
function set_select($field = '', $value = '', $default = FALSE)
{
$OBJ =& _get_validation_object();
if ($OBJ === FALSE)
{
if ( ! isset($_POST[$field]))
{
if (count($_POST) === 0)
{
return ' selected="selected"';
}
return '';
}
I simply changed this into this:
Code:
function set_select($field = '', $value = '', $default = FALSE)
{
$OBJ =& _get_validation_object();
if ($OBJ)
{
if ( ! isset($_POST[$field]))
{
if (count($_POST) === 0)
{
return ' selected="selected"';
}
return '';
}
I would like someone to reply for this,
thanks
Marco