View Full Version : Ajax tabs - form actions targeting specific tab

09-29-2009, 02:28 PM
1) Script Title: Ajax Tabs

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/ajaxtabscontent/index.htm

3) Describe problem: My Form action (already within a tab) just opens the page in a new window instead of targeting the tab... how do I make forms within the tab reload the tab and not the whole page?

09-29-2009, 02:39 PM
I have tried these things:

<form action="javascript: countries.loadajaxpage('mypage.php')" method="post">
Result: Reloads tab but without posting variables

<form action="mypage.php" target="_self" method="post">
Result: Reloads entire page

<INPUT TYPE=SUBMIT NAME=SUBMIT VALUE=SUBMIT onclick="javascript: countries.loadajaxpage('mypage.php')" />
Result: Reloads tab but without posting variables

09-29-2009, 02:51 PM
oh and I tried this and it didnt pass the variables either... now I will let someone else advise me from here .. I really need help with this. Thanks

<form action="content.php?countrytabs=0" method="post">

09-29-2009, 05:32 PM
One easy way is just to use the IFRAME mode of displaying the tab contents. When a form inside one of these contents is submitted, the result naturally stays inside the IFRAME.

Without using the IFRAME mode, the other method requires that you modify your form so its results are returned as Ajax content, and shown inside the desired DIV content container.