Combining two form elements
Posted: Thu Aug 14, 2008 2:12 pm
Hey all. New to the forums here.
I'm basically creating a timesheet here and I am wondering how to combine two form elements that would be generated dynamically.
the idea is to have one input field for inputing a task and another for inputing time spent doing said task.
how would I go about making sure that each time would get assigned to the correct task. this would eventually be put into a database.
i figured out how to loop through one of them like this.
is there a way to maybe group the form elements...maybe run another foreach for the hours and then combine the arrays?
any ideas are welcome.
I'm basically creating a timesheet here and I am wondering how to combine two form elements that would be generated dynamically.
the idea is to have one input field for inputing a task and another for inputing time spent doing said task.
how would I go about making sure that each time would get assigned to the correct task. this would eventually be put into a database.
i figured out how to loop through one of them like this.
Code: Select all
if(isset($_POST['submit'])){
foreach($_POST['detail'] as $detail){
echo $detai."<br>"l;
}
}any ideas are welcome.