Log in

View Full Version : How to get all the input fields in tab content control



coffak
03-28-2011, 09:36 PM
Hello, I am using the tab content control (http://www.dynamicdrive.com/dynamicindex17/ajaxtabscontent/demo.htm) and I have text inputs in every tab, but when I click to submit the form, I am only receiving the active inputs. So my question is, what can I do to get all the input from all the tabs when I submit the form?

this is my code for the html page that contains the tab control


<form id="fm-form" method="post" action="send_inputs">
<p>
- First tab shows default, inline content directly added inside container DIV<br />
- 2nd and 3rd tabs show external pages fetched via <b>Ajax</b><br />
- 4th tab shows an external page fetched via <b>IFRAME</b><br />
</p>

<ul id="countrytabs" class="shadetabs">
<li><a href="/CodeIgniter_2.0.0/APPS_app/html/correspondencia_view.htm" rel="countrycontainer" class="selected">Tab 1</a></li>
<li><a href="tab1.htm" rel="countrycontainer">Tab 2</a></li>
<li><a href="tab2.htm" rel="countrycontainer">Tab 3</a></li>
<li><a href="tab3.htm" rel="#iframe">Tab 4</a></li>
<li><a href="http://www.dynamicdrive.com">Dynamic Drive</a></li>
</ul>

<div id="countrydivcontainer" style="border:1px solid gray; width:450px; margin-bottom: 1em; padding: 10px">
<p>This is some default tab content, embedded directly inside this space and not via Ajax. It can be shown when no tabs are automatically selected, or associated with a certain tab, in this case, the first tab.</p>
</div>
<input name="Submit" value="registrar" type="submit" />
<script type="text/javascript">

var countries=new ddajaxtabs("countrytabs", "countrydivcontainer")
countries.setpersist(true)
countries.setselectedClassTarget("link") //"link" or "linkparent"
countries.init()

</script>

<p><a href="javascript: countries.expandit(3)">Dynamically select last Tab</a> | <a href="demo.htm?countrytabs=1">Reload page and select 2nd tab using URL parameter</a></p>

<hr />

</form>


Thanks in advance

fastsol1
03-28-2011, 10:57 PM
My guess is that because you have the tabs pulling from other files and not from code in the page you are on it's not able to read it for a form, but that's just a guess without actually trying it.

coffak
03-28-2011, 11:05 PM
Yes, I have the tabs pulling from other files the content of the tab... I'm gonna try to have all my tabs content in the main page.

coffak
03-29-2011, 12:05 AM
I am clueless I can't put all the content in the main page. I think that the functionality that I am looking for is very common, but since I can't find any resource, I am not sure if I am using in the right way this control or maybe the logic in PHP... I have like 3 days coding in this language.

Any help will be appreciated

fastsol1
03-29-2011, 12:35 AM
Ok, I don't think this will be possible with just php, you will possibly need to create hidden input fields on the other tab pages that hold all the other input fields that are not on that particular page cause the browser is only recognizing the active inputs cause the others are hidden to the browser. PHP can't transfer the data from one tab to the other without a page refresh at the very least cause php only works on the server side not client side, so javascript would be the only way I can think of to do this. You should probably ask in the Javascript forum instead.

coffak
03-29-2011, 12:59 AM
Thanks fastsol1, I will try with javascript... Regards.