Hi I am using jQuery UI Tabs as a form.
Because of this I can’t use Ajax because all tabs/content has to be present when sending the form. The form consists of 9 different tabs, each with lot of code.
Now I want to outsource the content of these tabs to each an individual file (tab1.php, tab2.php, …).
My solution so far:
-
I could include all the files (tab1.php, …)in the
<head>and than load each content as a variable.
I don’t like this because the code looks messy because of all the escaping. -
I use iframes. The frames only load when clicked.
<div id="tab-1"> <iframe src="..."></iframe> </div>
Is there a better approach?
Maybe using Ajax load-onceAll or something like that?… maybe something to prevent the iframe from reloading… I don’t know.
You can outsource the code to individual files then pull in their content with an Ajax jQuery call when the page loads:
Then you can use some validation in
onSubmitfunctions of the individual tabs forms to ensure they are not posted back until all are finished. This is just one possible solution.