Welcome Guest, Not a member yet? Register   Sign In
adding input fields without js/query
#8

[eluser]CroNiX[/eluser]
I was thinking of something similar.
1) have a checkbox in the form...if checked means need more fields...submit
2) in the form validation, check to see if this box is checked, if it is, fail the validation via custom rule (this will cause the form to be repopulated)
3) in the view, add a check to see if the checkbox value is present, if it is, add the extra needed fields
Code:
if($this->input->post('checkbox_name'))
{
    //echo out your extra form elements
}

This can get messy though...as you might need different sets of validation rules depending on if that checkbox is checked or not (to add additional rules for the new elements).


Messages In This Thread
adding input fields without js/query - by El Forum - 10-11-2010, 04:28 PM
adding input fields without js/query - by El Forum - 10-11-2010, 10:40 PM
adding input fields without js/query - by El Forum - 10-12-2010, 02:25 AM
adding input fields without js/query - by El Forum - 10-12-2010, 08:28 AM
adding input fields without js/query - by El Forum - 10-12-2010, 10:17 AM
adding input fields without js/query - by El Forum - 10-12-2010, 10:41 AM
adding input fields without js/query - by El Forum - 10-12-2010, 02:51 PM
adding input fields without js/query - by El Forum - 10-12-2010, 02:57 PM



Theme © iAndrew 2016 - Forum software by © MyBB