PDA

View Full Version : Tags and forms in php



kurakar
02-07-2011, 02:41 PM
Dear sir,

I created 3 tags and 3 different forms in each tags. While i am clicking second form and submit button on second tag , after submitting its going again to first tab. How can we stop that and stay on same tab.?

Please Explain...

djr33
02-07-2011, 07:00 PM
You will need to provide a link so we can help you.

Generally, I think the problem is that you are trying to use Javascript and PHP in the wrong way: submitting a form makes the page reload. And when the page reloads, it resets the tabs.

You could try three things:
1. Use different pages for each tab.
2. Submit the page using an indication in the URL like #tab2 so that Javascript will set the page to the tab you want.
3. Use AJAX to submit the form and the page will not need to reload. This is difficult, but it would be a good solution.