Currently I have data that it must has 1 title and 1 content, and randomly number (or none) link group (linktext and link ) , (as the it is dynamic generated) E.g. LinkText1 , Link1 , LinkText2, Link2....and so on. So, one example data is:
title:"abc"
content:"test"
linktext1:"yahoo"
link1:"http://yahoo.com"
my form is
<input type="text" name="linktext[]">
<input type="text" name="link[]">
The problem is, simply
$this->form_validation->set_rules('linkTxt[]', '連結標題', 'required');
$this->form_validation->set_rules('link[]', '連結地址', 'required');
is not working
I would like to if either linkTxt[0] or link[0] (or any pair) is exist , check the corresponding pair. If none of them exist (User can choose not to insert any link) (then no checking require) Thanks