PDA

View Full Version : Dynamic content in Ajax Tab Content



wroxbox
11-22-2006, 09:42 AM
1) Script Title:
Dynamic Ajax Content

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

3) Describe problem:
I have loaded the dynamic form inside tab that has and select -dropdown in top of the page. Depending on the selected value I wan't to refresh the forms content. Is it even possible to handle dynamic content with ajaxtabcontent?



<form action="?action=update" method="post" name="myForm">
Filter by Site:
<select name="condition" onchange=myForm.submit(); >
<option Value="0">Main site</option>
<option Value="1">CodeBase</option>
<option Value="2">Subsite 1</option>
</select>
</form>
Render the Value of option here

ddadmin
11-22-2006, 10:37 AM
I don't see how this is directly related to the Ajax Tabs content though? In general you can use Ajax to make a POST request, such as for a form, though you're certainly looking at custom coding it based on how your form is coded and what you wish to accomplish.

You can take a look at Basic Ajax Routine (http://www.dynamicdrive.com/dynamicindex17/ajaxroutine.htm), near the bottom of the page on POST requests.

wroxbox
11-22-2006, 11:07 AM
I don't see how this is directly related to the Ajax Tabs content though? In general you can use Ajax to make a POST request, such as for a form, though you're certainly looking at custom coding it based on how your form is coded and what you wish to accomplish.


The problem is that everytime I change the dropdown to another the page posts the form back to server and returns the same default value.. not the selected one.

So I can't actually change the rendered output by selecting it from the dropdown. The AjaxContentTab renders everytime the firstone (default) - and gives no possibility to change its output..

ddadmin
11-22-2006, 12:24 PM
The issue here is that Ajax Tab Content returns the source of an external page, which is static, not any changes made to it dynamically on the client side (by JavaScript) for example. You'll need to get a little creative to have your main page somehow recognize that a change has been made to the drop down menu, and update the menu per the change.

wroxbox
11-22-2006, 12:58 PM
Ok.

I managed to create it with javascript. Added a condition parameter to form and inserted onchange function that redirects user back to itself with another parametervalue.

The maqic was added to the tabbuilder page: It can now insert the parameter to the href="external.asp?condition=whatever" ..

Thanks!!!