Hi,
I had created a input fields in the View Page like
<div class="input text">
<label for="2">First Name (required) </label>
<input type="text" value="" style="width: 300px;" id="2" class="required" name="First Name"/>
</div>
<div class="input text">
<label for="5">Emailid</label>
<input type="text" value="" style="width: 300px;" id="5" name="Emailid"/><
/div>
<div class="input text">
<label for="6">Mobile Number</label>
<input type="text" value="" style="width: 30px;" id="6" name="Mobile Number"/>
<input type="text" value="" style="width: 30px;" id="6-1" name="Mobile Number"/>
<input type="text" value="" style="width: 70px;" id="6-2" name="Mobile Number"/>
</div>
these are all generated in the Page .I am retrieving the content values form this page in my CakePHp controller using
foreach ($_POST as $key => $value):
echo $key;echo $value;
endforeach;
For all the above fields i am getting the correct answer like First_Name=A&[email protected]&Mobile_Number=3
But for my Mobile Number field alone i am getting the value of the last id like 6-2.Why so .? HOw to retrieve the full value of the mobile number which is given in the three fields (6,6-1,6-2) ??Please suggest me.
Edit :
foreach ($_POST as $key => $value):
$mobile_number = implode('', $_POST['number']);
echo $mobile_number;
$this->data['Result']['form_id']=$formid;
$this->data['Result']['label']=Inflector::humanize($key);
$this->data['Result']['value']=$value;
$this->Form->submitForm($this->data);
endforeach;
i am saving the key and its values using like above (ie.., The controller doesn't know what are all fields are in the Fill Page). The fillpage may/maynot contain the field Phone Number.How do i assure that the page has Phonenumber field and to save its value with its Key.
Note: $key is the Fieldname and $value is my value of the field . Only for Phonenumber Field the values are array and in all other cases it is only a single value.