Jump to content

form and hidden div


delickate

Recommended Posts

Hi,

I've have a form with some hidden DIVs. all DIVs has some feilds..... i want that only display: block div should be a part of my form. hidden div content should not me a part of my form. but when i submit a form and get values it gives all values. even container is hidden or block.

 

would any one help me on this???

Thanks

Link to comment
https://forums.phpfreaks.com/topic/264930-form-and-hidden-div/
Share on other sites

Hi,

I've dynamic form. all div and fields are dynamic. so hard to ignore them. sample code is as follow

<form>
<select name="txtbrandCategory'.$i.'[]" id="txtbrandCategory'.$i.'"  class="branddropdowncss required" onchange="showfeildsperbrndCat(this, \''.$i.'\')"  id="brandcatslctbox">
		<option value=""> -- select -- </option>
-----------------------
------------------------
----------------------------
</select>
<?php

for(i=1; i<=10; i++)
{
?>
    <div id="divid23<?php echo $i; ?>" style="display:none"><input type="text" name=txtname[] /></div>

    <div id="divid42<?php echo $i; ?>" style="display:none"><input type="text" name=txtphone[] /></div>

   <div id="divid39<?php echo $i; ?>" style="display:none"><input type="text" name=txtemail[] /></div>
<?php
}
?>
</form>

 

on select box change one of the div will show up. but when i submit a form if return all dives data.

 

so i want to get only that div data which is display block.

 

hope you understand now.

 

thanks

 

Link to comment
https://forums.phpfreaks.com/topic/264930-form-and-hidden-div/#findComment-1357678
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.