i am working with multiple form in one page. Basically i have a form in which there are some element and when a user select one of the category from drop-down list in the form, it adds addition elements on the form depending on the category chosen. my problem occurs when i try to get the value from user input and save it into database. After fiddling with the code i realised that the code is unable to catch the value of the form after one div tag has occurred. let me explain through code.
<form>
<input type="text" name="" >
<select name="category" id="category" onchange="show()">
<option name="Phone" value="Phone" >Smartphone</option>
<option name="Laptop" value="Laptop" >laptop </option>
</select>
//(show() function will make one of the div tag visible(depending on category selected) and so it will display on screen.)
<div id="phone" style="visibility:hidden">
<form>
<some input elements....>
</form>
</div>
<div id="laptops" style="visibility:hidden">
<form>
<some input elements....>
</form>
</div>
</form>
now in php when i try to get the input value using $_POST i can only access the value of first div tag which is with id="phone" but when i chose category laptop, even though it display on screen correctly i am not getting the value of user input. i have checked the forms and there is no error since when i swap the forms around, it have same problem.